Skip to content

Commit

Permalink
added test for node types rest api call
Browse files Browse the repository at this point in the history
  • Loading branch information
Snehal Kumbhar committed Apr 29, 2019
1 parent 08a72fc commit 7e47725
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions aiida/backends/tests/restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,3 +876,18 @@ def test_schema(self):
available_properties = response["data"]["fields"].keys()
for prop in response["data"]["ordering"]:
self.assertIn(prop, available_properties)

def test_node_types(self):
"""
Test the rest api call to get list of available node types
"""
url = self.get_url_prefix() + '/nodes/types'
with self.app.test_client() as client:
rv = client.get(url)
response = json.loads(rv.data)
self.assertEqual(response["data"]["calculation"], ["calculation.Calculation."])
expected_data_types = ["data.array.kpoints.KpointsData.", "data.cif.CifData.", "data.parameter.ParameterData.", "data.structure.StructureData."]
self.assertEqual(response["data"]["data"], expected_data_types)
RESTApiTestCase.compare_extra_response_data(self, "nodes",
url,
response)

0 comments on commit 7e47725

Please sign in to comment.