Commit 9bc2c1d1 authored by Spiros Koulouzis's avatar Spiros Koulouzis

added test for doc ids

parent e33cdc35
...@@ -21,7 +21,7 @@ class TestDefaultController(BaseTestCase): ...@@ -21,7 +21,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_properties'.format( '/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_properties'.format(
id=id_example, node_name='compute'), id=id_example, node_name='compute'),
...@@ -36,7 +36,7 @@ class TestDefaultController(BaseTestCase): ...@@ -36,7 +36,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_types'.format( '/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_types'.format(
id=id_example, node_name='compute'), id=id_example, node_name='compute'),
...@@ -51,7 +51,7 @@ class TestDefaultController(BaseTestCase): ...@@ -51,7 +51,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_requirements'.format( '/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_requirements'.format(
id=id_example, node_name='kubernetes'), id=id_example, node_name='kubernetes'),
...@@ -67,7 +67,7 @@ class TestDefaultController(BaseTestCase): ...@@ -67,7 +67,7 @@ class TestDefaultController(BaseTestCase):
""" """
# query_string = [('anchors', 'anchors_example'), ('derived_from', 'derived_from_example')] # query_string = [('anchors', 'anchors_example'), ('derived_from', 'derived_from_example')]
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/dsl_definitions'.format(id=id_example), '/tosca-sure/1.0.0/tosca_template/{id}/dsl_definitions'.format(id=id_example),
method='GET') method='GET')
...@@ -79,7 +79,7 @@ class TestDefaultController(BaseTestCase): ...@@ -79,7 +79,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/imports'.format(id=id_example), '/tosca-sure/1.0.0/tosca_template/{id}/imports'.format(id=id_example),
method='GET') method='GET')
...@@ -91,7 +91,7 @@ class TestDefaultController(BaseTestCase): ...@@ -91,7 +91,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_outputs.yaml') id_example = self.upload_file('application_example_outputs.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/outputs'.format( '/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/outputs'.format(
id=id_example, node_name='compute'), id=id_example, node_name='compute'),
...@@ -106,7 +106,7 @@ class TestDefaultController(BaseTestCase): ...@@ -106,7 +106,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/properties'.format( '/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/properties'.format(
id=id_example, node_name='compute'), id=id_example, node_name='compute'),
...@@ -121,7 +121,7 @@ class TestDefaultController(BaseTestCase): ...@@ -121,7 +121,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/requirements'.format( '/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/requirements'.format(
id=id_example, node_name='kubernetes'), id=id_example, node_name='kubernetes'),
...@@ -136,7 +136,7 @@ class TestDefaultController(BaseTestCase): ...@@ -136,7 +136,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
query_string = [('type_name', None), query_string = [('type_name', None),
('node_name', 'compute'), ('node_name', 'compute'),
('has_interfaces', True), ('has_interfaces', True),
...@@ -207,7 +207,7 @@ class TestDefaultController(BaseTestCase): ...@@ -207,7 +207,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/type_name'.format( '/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/type_name'.format(
id=id_example, node_name='compute'), id=id_example, node_name='compute'),
...@@ -222,7 +222,7 @@ class TestDefaultController(BaseTestCase): ...@@ -222,7 +222,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/derived_from'.format( '/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/derived_from'.format(
id=id_example, node_name='kubernetes'), id=id_example, node_name='kubernetes'),
...@@ -237,7 +237,7 @@ class TestDefaultController(BaseTestCase): ...@@ -237,7 +237,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/related'.format( '/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/related'.format(
id=id_example, node_name='mysql'), id=id_example, node_name='mysql'),
...@@ -252,7 +252,7 @@ class TestDefaultController(BaseTestCase): ...@@ -252,7 +252,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
query_string = [('type_name', None), query_string = [('type_name', None),
('derived_from', None)] ('derived_from', None)]
response = self.client.open( response = self.client.open(
...@@ -267,7 +267,7 @@ class TestDefaultController(BaseTestCase): ...@@ -267,7 +267,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template'.format(id=id_example), '/tosca-sure/1.0.0/tosca_template/{id}/topology_template'.format(id=id_example),
method='GET') method='GET')
...@@ -281,7 +281,7 @@ class TestDefaultController(BaseTestCase): ...@@ -281,7 +281,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}'.format(id=id_example), '/tosca-sure/1.0.0/tosca_template/{id}'.format(id=id_example),
method='GET') method='GET')
...@@ -295,7 +295,7 @@ class TestDefaultController(BaseTestCase): ...@@ -295,7 +295,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
query_string = [('kind_of_type', 'interface_types'), query_string = [('kind_of_type', 'interface_types'),
('has_interfaces', None), ('has_interfaces', None),
('type_name', 'tosca.interfaces.ARTICONF.CloudsStorm'), ('type_name', 'tosca.interfaces.ARTICONF.CloudsStorm'),
...@@ -335,7 +335,7 @@ class TestDefaultController(BaseTestCase): ...@@ -335,7 +335,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
properties = {'properties': {'cpu_frequency': '2 GHz'}} properties = {'properties': {'cpu_frequency': '2 GHz'}}
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/properties'.format( '/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates/{node_name}/properties'.format(
...@@ -355,7 +355,7 @@ class TestDefaultController(BaseTestCase): ...@@ -355,7 +355,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
response = self.client.open( response = self.client.open(
'/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates'.format(id=id_example), '/tosca-sure/1.0.0/tosca_template/{id}/topology_template/node_templates'.format(id=id_example),
method='GET', method='GET',
...@@ -371,7 +371,7 @@ class TestDefaultController(BaseTestCase): ...@@ -371,7 +371,7 @@ class TestDefaultController(BaseTestCase):
""" """
id_example = self.upload_file('application_example_2_topologies.yaml') id_example = self.upload_file('application_example_2_topologies.yaml')
self.assertTrue (id_example >= 0) self.assertTrue(id_example.strip().isdigit())
query_string = [('instance_name', 'instance_name_example'), query_string = [('instance_name', 'instance_name_example'),
('operation_name', 'provision')] ('operation_name', 'provision')]
response = self.client.open( response = self.client.open(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment