From e691376d1bff4d815d671e1efd2dc6cb40b1bedc Mon Sep 17 00:00:00 2001 From: sahdev zala Date: Wed, 30 Nov 2016 11:30:30 -0500 Subject: [PATCH] Organize containers and other tests Organize tests for easy references and future addition. Change-Id: I156cffaf8693f069614c326fe05e0c4b484fe910 --- .../test_container_docker_my_sql.yaml} | 0 .../test_custom_interface_in_template.yaml | 2 +- .../test_custom_interface_invalid_operation.yaml | 2 +- .../data/{ => load_balancer}/tosca_load_balancer.yaml | 0 .../tests/data/{ => node_filter}/test_node_filter.yaml | 0 .../test_custom_relationship.yaml} | 2 +- .../test_repositories_definition.yaml | 0 .../tosca_repositories_test_definition.yaml | 0 .../data/{ => requirements}/test_requirements.yaml | 2 +- toscaparser/tests/test_custom_relationships.py | 2 +- toscaparser/tests/test_toscatpl.py | 10 +++++----- toscaparser/tests/test_toscatplvalidation.py | 4 ++-- 12 files changed, 12 insertions(+), 12 deletions(-) rename toscaparser/tests/data/{test_containers.yaml => containers/test_container_docker_my_sql.yaml} (100%) rename toscaparser/tests/data/{ => interfaces}/test_custom_interface_in_template.yaml (93%) rename toscaparser/tests/data/{ => interfaces}/test_custom_interface_invalid_operation.yaml (90%) rename toscaparser/tests/data/{ => load_balancer}/tosca_load_balancer.yaml (100%) rename toscaparser/tests/data/{ => node_filter}/test_node_filter.yaml (100%) rename toscaparser/tests/data/{test_custom_relationships.yaml => relationship/test_custom_relationship.yaml} (95%) rename toscaparser/tests/data/{ => repositories}/test_repositories_definition.yaml (100%) rename toscaparser/tests/data/{ => repositories}/tosca_repositories_test_definition.yaml (100%) rename toscaparser/tests/data/{ => requirements}/test_requirements.yaml (98%) diff --git a/toscaparser/tests/data/test_containers.yaml b/toscaparser/tests/data/containers/test_container_docker_my_sql.yaml similarity index 100% rename from toscaparser/tests/data/test_containers.yaml rename to toscaparser/tests/data/containers/test_container_docker_my_sql.yaml diff --git a/toscaparser/tests/data/test_custom_interface_in_template.yaml b/toscaparser/tests/data/interfaces/test_custom_interface_in_template.yaml similarity index 93% rename from toscaparser/tests/data/test_custom_interface_in_template.yaml rename to toscaparser/tests/data/interfaces/test_custom_interface_in_template.yaml index b68febee..c23917cf 100644 --- a/toscaparser/tests/data/test_custom_interface_in_template.yaml +++ b/toscaparser/tests/data/interfaces/test_custom_interface_in_template.yaml @@ -4,7 +4,7 @@ description: > TOSCA simple profile with valid custom interface and operations. imports: - - custom_types/custom_interface.yaml + - ../custom_types/custom_interface.yaml topology_template: diff --git a/toscaparser/tests/data/test_custom_interface_invalid_operation.yaml b/toscaparser/tests/data/interfaces/test_custom_interface_invalid_operation.yaml similarity index 90% rename from toscaparser/tests/data/test_custom_interface_invalid_operation.yaml rename to toscaparser/tests/data/interfaces/test_custom_interface_invalid_operation.yaml index 90e594cc..d56ad9ca 100644 --- a/toscaparser/tests/data/test_custom_interface_invalid_operation.yaml +++ b/toscaparser/tests/data/interfaces/test_custom_interface_invalid_operation.yaml @@ -4,7 +4,7 @@ description: > TOSCA simple profile with invalid custom operation. imports: - - custom_types/custom_interface.yaml + - ../custom_types/custom_interface.yaml topology_template: diff --git a/toscaparser/tests/data/tosca_load_balancer.yaml b/toscaparser/tests/data/load_balancer/tosca_load_balancer.yaml similarity index 100% rename from toscaparser/tests/data/tosca_load_balancer.yaml rename to toscaparser/tests/data/load_balancer/tosca_load_balancer.yaml diff --git a/toscaparser/tests/data/test_node_filter.yaml b/toscaparser/tests/data/node_filter/test_node_filter.yaml similarity index 100% rename from toscaparser/tests/data/test_node_filter.yaml rename to toscaparser/tests/data/node_filter/test_node_filter.yaml diff --git a/toscaparser/tests/data/test_custom_relationships.yaml b/toscaparser/tests/data/relationship/test_custom_relationship.yaml similarity index 95% rename from toscaparser/tests/data/test_custom_relationships.yaml rename to toscaparser/tests/data/relationship/test_custom_relationship.yaml index 9c8171d3..81b92b40 100644 --- a/toscaparser/tests/data/test_custom_relationships.yaml +++ b/toscaparser/tests/data/relationship/test_custom_relationship.yaml @@ -3,7 +3,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0 description: Test template for deploying a single server with predefined properties and custom relationship types imports: - - custom_types/custom_relationship_type_defs.yaml + - ../custom_types/custom_relationship_type_defs.yaml topology_template: node_templates: diff --git a/toscaparser/tests/data/test_repositories_definition.yaml b/toscaparser/tests/data/repositories/test_repositories_definition.yaml similarity index 100% rename from toscaparser/tests/data/test_repositories_definition.yaml rename to toscaparser/tests/data/repositories/test_repositories_definition.yaml diff --git a/toscaparser/tests/data/tosca_repositories_test_definition.yaml b/toscaparser/tests/data/repositories/tosca_repositories_test_definition.yaml similarity index 100% rename from toscaparser/tests/data/tosca_repositories_test_definition.yaml rename to toscaparser/tests/data/repositories/tosca_repositories_test_definition.yaml diff --git a/toscaparser/tests/data/test_requirements.yaml b/toscaparser/tests/data/requirements/test_requirements.yaml similarity index 98% rename from toscaparser/tests/data/test_requirements.yaml rename to toscaparser/tests/data/requirements/test_requirements.yaml index 269c46d9..bb675776 100644 --- a/toscaparser/tests/data/test_requirements.yaml +++ b/toscaparser/tests/data/requirements/test_requirements.yaml @@ -4,7 +4,7 @@ description: > Test Requirements. imports: - - custom_types/wordpress.yaml + - ../custom_types/wordpress.yaml topology_template: node_templates: diff --git a/toscaparser/tests/test_custom_relationships.py b/toscaparser/tests/test_custom_relationships.py index 71de0c21..9ae85d54 100644 --- a/toscaparser/tests/test_custom_relationships.py +++ b/toscaparser/tests/test_custom_relationships.py @@ -21,7 +21,7 @@ class CustomRelationshipTypesTest(TestCase): '''TOSCA template.''' tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/test_custom_relationships.yaml") + "data/relationship/test_custom_relationship.yaml") tosca = ToscaTemplate(tosca_tpl) def test_version(self): diff --git a/toscaparser/tests/test_toscatpl.py b/toscaparser/tests/test_toscatpl.py index b294529c..197a63f4 100644 --- a/toscaparser/tests/test_toscatpl.py +++ b/toscaparser/tests/test_toscatpl.py @@ -38,7 +38,7 @@ class ToscaTemplateTest(TestCase): "data/tosca_elk.yaml") tosca_repo_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/tosca_repositories_test_definition.yaml") + "data/repositories/tosca_repositories_test_definition.yaml") def test_version(self): self.assertEqual(self.tosca.version, "tosca_simple_yaml_1_0") @@ -287,7 +287,7 @@ class ToscaTemplateTest(TestCase): """ tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/test_requirements.yaml") + "data/requirements/test_requirements.yaml") tosca = ToscaTemplate(tosca_tpl) for node_tpl in tosca.nodetemplates: if node_tpl.name == 'my_app': @@ -752,7 +752,7 @@ class ToscaTemplateTest(TestCase): def test_node_filter(self): tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/test_node_filter.yaml") + "data/node_filter/test_node_filter.yaml") ToscaTemplate(tosca_tpl) def test_attributes_inheritance(self): @@ -764,7 +764,7 @@ class ToscaTemplateTest(TestCase): def test_repositories_definition(self): tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/test_repositories_definition.yaml") + "data/repositories/test_repositories_definition.yaml") ToscaTemplate(tosca_tpl) def test_custom_caps_def(self): @@ -824,7 +824,7 @@ class ToscaTemplateTest(TestCase): def test_containers(self): tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/test_containers.yaml") + "data/containers/test_container_docker_my_sql.yaml") ToscaTemplate(tosca_tpl, parsed_params={"mysql_root_pwd": "12345678"}) def test_endpoint_on_compute(self): diff --git a/toscaparser/tests/test_toscatplvalidation.py b/toscaparser/tests/test_toscatplvalidation.py index 3dd0d0d3..e87744a3 100644 --- a/toscaparser/tests/test_toscatplvalidation.py +++ b/toscaparser/tests/test_toscatplvalidation.py @@ -42,13 +42,13 @@ class ToscaTemplateValidationTest(TestCase): def test_custom_interface_allowed(self): tpl_path = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/test_custom_interface_in_template.yaml") + "data/interfaces/test_custom_interface_in_template.yaml") self.assertIsNotNone(ToscaTemplate(tpl_path)) def test_custom_interface_invalid_operation(self): tpl_path = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/test_custom_interface_invalid_operation.yaml") + "data/interfaces/test_custom_interface_invalid_operation.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tpl_path) exception.ExceptionCollector.assertExceptionMessage(