-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
8498ae1
commit a333f0f
Showing
14 changed files
with
329 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*** KET with query components *** | ||
ket_with_query_components.ket:SUCCEED | ||
*** KET with query properties *** | ||
ket_with_query_properties.ket:SUCCEED | ||
*** KET with custom query *** | ||
ket_with_custom_query.ket:SUCCEED |
2 changes: 0 additions & 2 deletions
2
api/tests/integration/ref/formats/ket_with_query_components.py.out
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
api/tests/integration/ref/formats/ket_with_query_properties.py.out
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import difflib | ||
import os | ||
import sys | ||
|
||
|
||
def find_diff(a, b): | ||
return "\n".join(difflib.unified_diff(a.splitlines(), b.splitlines())) | ||
|
||
|
||
sys.path.append( | ||
os.path.normpath( | ||
os.path.join(os.path.abspath(__file__), "..", "..", "..", "common") | ||
) | ||
) | ||
from env_indigo import * # noqa | ||
|
||
indigo = Indigo() | ||
indigo.setOption("json-saving-pretty", True) | ||
|
||
ref_path = joinPathPy("ref/", __file__) | ||
|
||
|
||
def check_ket_file(name): | ||
filename = os.path.join(ref_path, name) | ||
|
||
mol = indigo.loadQueryMoleculeFromFile(filename) | ||
with open(filename, "r") as file: | ||
ket_ref = file.read() | ||
ket = mol.json() | ||
diff = find_diff(ket_ref, ket) | ||
if not diff: | ||
print(name + ":SUCCEED") | ||
else: | ||
print(name + ":FAILED") | ||
print(diff) | ||
|
||
|
||
print("*** KET with query components ***") | ||
check_ket_file("ket_with_query_components.ket") | ||
|
||
print("*** KET with query properties ***") | ||
check_ket_file("ket_with_query_properties.ket") | ||
|
||
print("*** KET with custom query ***") | ||
check_ket_file("ket_with_custom_query.ket") |
35 changes: 0 additions & 35 deletions
35
api/tests/integration/tests/formats/ket_with_query_components.py
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
api/tests/integration/tests/formats/ket_with_query_properties.py
This file was deleted.
Oops, something went wrong.
123 changes: 123 additions & 0 deletions
123
api/tests/integration/tests/formats/ref/ket_with_custom_query.ket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"root": { | ||
"nodes": [ | ||
{ | ||
"$ref": "mol0" | ||
} | ||
] | ||
}, | ||
"mol0": { | ||
"type": "molecule", | ||
"atoms": [ | ||
{ | ||
"label": "C", | ||
"location": [ | ||
6.3348493576049809, | ||
-5.550074577331543, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
8.06515121459961, | ||
-5.549589157104492, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
7.2016377449035648, | ||
-5.049966812133789, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
8.06515121459961, | ||
-6.55053186416626, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
6.3348493576049809, | ||
-6.555019855499268, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"label": "C", | ||
"location": [ | ||
7.203820705413818, | ||
-7.050033092498779, | ||
0.0 | ||
], | ||
"queryProperties": { | ||
"customQuery": "C&X3,N&X2" | ||
} | ||
} | ||
], | ||
"bonds": [ | ||
{ | ||
"type": 2, | ||
"atoms": [ | ||
2, | ||
0 | ||
] | ||
}, | ||
{ | ||
"type": 2, | ||
"atoms": [ | ||
3, | ||
1 | ||
] | ||
}, | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
0, | ||
4 | ||
] | ||
}, | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
1, | ||
2 | ||
] | ||
}, | ||
{ | ||
"type": 2, | ||
"atoms": [ | ||
4, | ||
5 | ||
] | ||
}, | ||
{ | ||
"type": 1, | ||
"atoms": [ | ||
5, | ||
3 | ||
] | ||
} | ||
], | ||
"sgroups": [ | ||
{ | ||
"type": "MUL", | ||
"atoms": [ | ||
0, | ||
1, | ||
2, | ||
3, | ||
4, | ||
5 | ||
], | ||
"mul": 1 | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.