Organize containers and other tests
Organize tests for easy references and future addition. Change-Id: I156cffaf8693f069614c326fe05e0c4b484fe910
This commit is contained in:
parent
dab75f048e
commit
e691376d1b
toscaparser/tests
data
containers
interfaces
load_balancer
node_filter
relationship
repositories
requirements
@ -4,7 +4,7 @@ description: >
|
|||||||
TOSCA simple profile with valid custom interface and operations.
|
TOSCA simple profile with valid custom interface and operations.
|
||||||
|
|
||||||
imports:
|
imports:
|
||||||
- custom_types/custom_interface.yaml
|
- ../custom_types/custom_interface.yaml
|
||||||
|
|
||||||
topology_template:
|
topology_template:
|
||||||
|
|
@ -4,7 +4,7 @@ description: >
|
|||||||
TOSCA simple profile with invalid custom operation.
|
TOSCA simple profile with invalid custom operation.
|
||||||
|
|
||||||
imports:
|
imports:
|
||||||
- custom_types/custom_interface.yaml
|
- ../custom_types/custom_interface.yaml
|
||||||
|
|
||||||
topology_template:
|
topology_template:
|
||||||
|
|
@ -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
|
description: Test template for deploying a single server with predefined properties and custom relationship types
|
||||||
|
|
||||||
imports:
|
imports:
|
||||||
- custom_types/custom_relationship_type_defs.yaml
|
- ../custom_types/custom_relationship_type_defs.yaml
|
||||||
|
|
||||||
topology_template:
|
topology_template:
|
||||||
node_templates:
|
node_templates:
|
@ -4,7 +4,7 @@ description: >
|
|||||||
Test Requirements.
|
Test Requirements.
|
||||||
|
|
||||||
imports:
|
imports:
|
||||||
- custom_types/wordpress.yaml
|
- ../custom_types/wordpress.yaml
|
||||||
|
|
||||||
topology_template:
|
topology_template:
|
||||||
node_templates:
|
node_templates:
|
@ -21,7 +21,7 @@ class CustomRelationshipTypesTest(TestCase):
|
|||||||
'''TOSCA template.'''
|
'''TOSCA template.'''
|
||||||
tosca_tpl = os.path.join(
|
tosca_tpl = os.path.join(
|
||||||
os.path.dirname(os.path.abspath(__file__)),
|
os.path.dirname(os.path.abspath(__file__)),
|
||||||
"data/test_custom_relationships.yaml")
|
"data/relationship/test_custom_relationship.yaml")
|
||||||
tosca = ToscaTemplate(tosca_tpl)
|
tosca = ToscaTemplate(tosca_tpl)
|
||||||
|
|
||||||
def test_version(self):
|
def test_version(self):
|
||||||
|
@ -38,7 +38,7 @@ class ToscaTemplateTest(TestCase):
|
|||||||
"data/tosca_elk.yaml")
|
"data/tosca_elk.yaml")
|
||||||
tosca_repo_tpl = os.path.join(
|
tosca_repo_tpl = os.path.join(
|
||||||
os.path.dirname(os.path.abspath(__file__)),
|
os.path.dirname(os.path.abspath(__file__)),
|
||||||
"data/tosca_repositories_test_definition.yaml")
|
"data/repositories/tosca_repositories_test_definition.yaml")
|
||||||
|
|
||||||
def test_version(self):
|
def test_version(self):
|
||||||
self.assertEqual(self.tosca.version, "tosca_simple_yaml_1_0")
|
self.assertEqual(self.tosca.version, "tosca_simple_yaml_1_0")
|
||||||
@ -287,7 +287,7 @@ class ToscaTemplateTest(TestCase):
|
|||||||
"""
|
"""
|
||||||
tosca_tpl = os.path.join(
|
tosca_tpl = os.path.join(
|
||||||
os.path.dirname(os.path.abspath(__file__)),
|
os.path.dirname(os.path.abspath(__file__)),
|
||||||
"data/test_requirements.yaml")
|
"data/requirements/test_requirements.yaml")
|
||||||
tosca = ToscaTemplate(tosca_tpl)
|
tosca = ToscaTemplate(tosca_tpl)
|
||||||
for node_tpl in tosca.nodetemplates:
|
for node_tpl in tosca.nodetemplates:
|
||||||
if node_tpl.name == 'my_app':
|
if node_tpl.name == 'my_app':
|
||||||
@ -752,7 +752,7 @@ class ToscaTemplateTest(TestCase):
|
|||||||
def test_node_filter(self):
|
def test_node_filter(self):
|
||||||
tosca_tpl = os.path.join(
|
tosca_tpl = os.path.join(
|
||||||
os.path.dirname(os.path.abspath(__file__)),
|
os.path.dirname(os.path.abspath(__file__)),
|
||||||
"data/test_node_filter.yaml")
|
"data/node_filter/test_node_filter.yaml")
|
||||||
ToscaTemplate(tosca_tpl)
|
ToscaTemplate(tosca_tpl)
|
||||||
|
|
||||||
def test_attributes_inheritance(self):
|
def test_attributes_inheritance(self):
|
||||||
@ -764,7 +764,7 @@ class ToscaTemplateTest(TestCase):
|
|||||||
def test_repositories_definition(self):
|
def test_repositories_definition(self):
|
||||||
tosca_tpl = os.path.join(
|
tosca_tpl = os.path.join(
|
||||||
os.path.dirname(os.path.abspath(__file__)),
|
os.path.dirname(os.path.abspath(__file__)),
|
||||||
"data/test_repositories_definition.yaml")
|
"data/repositories/test_repositories_definition.yaml")
|
||||||
ToscaTemplate(tosca_tpl)
|
ToscaTemplate(tosca_tpl)
|
||||||
|
|
||||||
def test_custom_caps_def(self):
|
def test_custom_caps_def(self):
|
||||||
@ -824,7 +824,7 @@ class ToscaTemplateTest(TestCase):
|
|||||||
def test_containers(self):
|
def test_containers(self):
|
||||||
tosca_tpl = os.path.join(
|
tosca_tpl = os.path.join(
|
||||||
os.path.dirname(os.path.abspath(__file__)),
|
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"})
|
ToscaTemplate(tosca_tpl, parsed_params={"mysql_root_pwd": "12345678"})
|
||||||
|
|
||||||
def test_endpoint_on_compute(self):
|
def test_endpoint_on_compute(self):
|
||||||
|
@ -42,13 +42,13 @@ class ToscaTemplateValidationTest(TestCase):
|
|||||||
def test_custom_interface_allowed(self):
|
def test_custom_interface_allowed(self):
|
||||||
tpl_path = os.path.join(
|
tpl_path = os.path.join(
|
||||||
os.path.dirname(os.path.abspath(__file__)),
|
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))
|
self.assertIsNotNone(ToscaTemplate(tpl_path))
|
||||||
|
|
||||||
def test_custom_interface_invalid_operation(self):
|
def test_custom_interface_invalid_operation(self):
|
||||||
tpl_path = os.path.join(
|
tpl_path = os.path.join(
|
||||||
os.path.dirname(os.path.abspath(__file__)),
|
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,
|
self.assertRaises(exception.ValidationError,
|
||||||
ToscaTemplate, tpl_path)
|
ToscaTemplate, tpl_path)
|
||||||
exception.ExceptionCollector.assertExceptionMessage(
|
exception.ExceptionCollector.assertExceptionMessage(
|
||||||
|
Loading…
Reference in New Issue
Block a user