Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
duboyal committed May 3, 2024
1 parent 82337e4 commit 817a9a5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
3 changes: 1 addition & 2 deletions tests/fixtures/subobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ def complex_ingredient_node(complex_material_node, complex_quantity_node) -> cri
"""
complex ingredient node with all possible parameters filled
"""
# complex_ingredient_node = cript.Ingredient(material=complex_material_node, quantity=[complex_quantity_node], keyword=["catalyst"])
# complex_ingredient_node = cript.Ingredient(material={}, quantity=[complex_quantity_node], keyword=["catalyst"])
complex_ingredient_node = cript.Ingredient(material=complex_material_node, quantity=[complex_quantity_node], keyword=["catalyst"])

return complex_ingredient_node

Expand Down
14 changes: 11 additions & 3 deletions tests/nodes/primary_nodes/test_computational_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,21 @@ def test_serialize_computational_process_to_json(simple_computational_process_no
}

ref_dict = json.loads(simple_computational_process_node.json)
ref_dict["ingredient"][0]["material"] = {}
ref_dict = strip_uid_from_dict(ref_dict)

print("****REFDICT")
print(type(ref_dict))
print(ref_dict)

print("****EXPECTED DICT")
print(type(expected_dict))
print(expected_dict)

assert ref_dict == expected_dict


def test_integration_computational_process(
cript_api, simple_project_node, simple_inventory_node, simple_collection_node, simple_experiment_node, simplest_computational_process_node, simple_material_node, simple_data_node, simple_ingredient_node
) -> None:
def test_integration_computational_process(cript_api, simple_project_node, simple_inventory_node, simple_collection_node, simple_experiment_node, simplest_computational_process_node, simple_material_node, simple_data_node) -> None:
"""
integration test between Python SDK and API Client
Expand Down
7 changes: 4 additions & 3 deletions tests/nodes/primary_nodes/test_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_all_getters_and_setters_for_experiment(
assert simple_experiment_node.citation == []


def test_experiment_json(simple_process_node, simple_computation_node, simplest_computational_process_node, simple_data_node, complex_citation_node, complex_citation_dict) -> None:
def test_experiment_json(simple_process_node, simple_computation_node, simple_computational_process_node, simple_data_node, complex_citation_node, complex_citation_dict) -> None:
"""
tests that the experiment JSON is functioning correctly
Expand All @@ -128,8 +128,8 @@ def test_experiment_json(simple_process_node, simple_computation_node, simplest_
name=experiment_name,
process=[simple_process_node],
computation=[simple_computation_node],
computation_process=[simplest_computational_process_node],
# computation_process=[simple_computational_process_node],
# computation_process=[simplest_computational_process_node],
computation_process=[simple_computational_process_node],
data=[simple_data_node],
funding=experiment_funders,
citation=[citation],
Expand Down Expand Up @@ -193,6 +193,7 @@ def test_experiment_json(simple_process_node, simple_computation_node, simplest_

ref_dict = json.loads(my_experiment.json)
ref_dict = strip_uid_from_dict(ref_dict)
ref_dict["computation_process"][0]["ingredient"][0]["material"] = {}

assert len(ref_dict) == len(expected_experiment_dict)

Expand Down

0 comments on commit 817a9a5

Please sign in to comment.