TOSCA: organize test templates

The test templates has two different locations, there is no overlapping but
it makes sense to have them all to a common place for easy reference.

Change-Id: I37badc8fb2fa6ae8286d0007a229ee76e8fb1986
This commit is contained in:
spzala 2015-04-21 00:15:39 -07:00
parent 0370edf17a
commit 2d1db56c43
17 changed files with 20 additions and 12 deletions

View File

@ -22,7 +22,8 @@ class ToscaTemplateOutputTest(TestCase):
def test_translate_output(self):
tosca_tpl = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"../../tests/data/tosca_elk.yaml")
"../../toscalib/tests/data/"
"tosca_nodejs_mongodb_two_instances.yaml")
tosca = ToscaTemplate(tosca_tpl)
translate = TOSCATranslator(tosca, [])
hot_translation = translate.translate()

View File

@ -26,8 +26,8 @@ class ToscaBlockStorageTest(TestCase):
'''TOSCA template with single BlockStorage and Attachment.'''
tosca_tpl = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"data/tosca_blockstorage_with_attachment.yaml")
"../toscalib/tests/data/storage/"
"tosca_blockstorage_with_attachment.yaml")
tosca = ToscaTemplate(tosca_tpl)
translate = TOSCATranslator(tosca, self.parsed_params)
output = translate.translate()
@ -63,7 +63,8 @@ class ToscaBlockStorageTest(TestCase):
'''TOSCA template with single BlockStorage and Attachment.'''
tosca_tpl = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"data/tosca_blockstorage_with_attachment_notation1.yaml")
"../toscalib/tests/data/storage/"
"tosca_blockstorage_with_attachment_notation1.yaml")
tosca = ToscaTemplate(tosca_tpl)
translate = TOSCATranslator(tosca, self.parsed_params)
@ -92,7 +93,8 @@ class ToscaBlockStorageTest(TestCase):
'''TOSCA template with single BlockStorage and Attachment.'''
tosca_tpl = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"data/tosca_blockstorage_with_attachment_notation2.yaml")
"../toscalib/tests/data/storage/"
"tosca_blockstorage_with_attachment_notation2.yaml")
tosca = ToscaTemplate(tosca_tpl)
translate = TOSCATranslator(tosca, self.parsed_params)
@ -128,7 +130,8 @@ class ToscaBlockStorageTest(TestCase):
'''TOSCA template with multiple BlockStorage and Attachment.'''
tosca_tpl = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"data/tosca_multiple_blockstorage_with_attachment.yaml")
"../toscalib/tests/data/storage/"
"tosca_multiple_blockstorage_with_attachment.yaml")
tosca = ToscaTemplate(tosca_tpl)
translated_volume_attachment = []
translate = TOSCATranslator(tosca, self.parsed_params)

View File

@ -25,7 +25,7 @@ class ToscaMongoNodejsTest(TestCase):
'''TOSCA template with nodejs, app and mongodb on 2 servers.'''
tosca_tpl = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"data/tosca_elk.yaml")
"../toscalib/tests/data/tosca_nodejs_mongodb_two_instances.yaml")
tosca = ToscaTemplate(tosca_tpl)
def test_relationship_def(self):

View File

@ -25,7 +25,8 @@ class ToscaNetworkTest(TestCase):
'''TOSCA template with single Network and single Compute.'''
tosca_tpl = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'data/tosca_one_server_one_network.yaml')
"../toscalib/tests/data/network/"
"tosca_one_server_one_network.yaml")
tosca = ToscaTemplate(tosca_tpl)
translate = TOSCATranslator(tosca, self.parsed_params)
@ -78,7 +79,8 @@ class ToscaNetworkTest(TestCase):
'''TOSCA template with single Network and two Computes.'''
tosca_tpl = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'data/tosca_two_servers_one_network.yaml')
"../toscalib/tests/data/network/"
"tosca_two_servers_one_network.yaml")
tosca = ToscaTemplate(tosca_tpl)
translate = TOSCATranslator(tosca, self.parsed_params)
@ -145,7 +147,8 @@ class ToscaNetworkTest(TestCase):
'''TOSCA template with 1 server attached to existing network.'''
tosca_tpl = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'data/tosca_server_on_existing_network.yaml')
"../toscalib/tests/data/network/"
"tosca_server_on_existing_network.yaml")
tosca = ToscaTemplate(tosca_tpl)
translate = TOSCATranslator(tosca, self.parsed_params)
@ -176,7 +179,8 @@ class ToscaNetworkTest(TestCase):
'''TOSCA template with three Networks and single Compute.'''
tosca_tpl = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'data/tosca_one_server_three_networks.yaml')
"../toscalib/tests/data/network/"
"tosca_one_server_three_networks.yaml")
tosca = ToscaTemplate(tosca_tpl)
translate = TOSCATranslator(tosca, self.parsed_params)

View File

@ -4,7 +4,7 @@ description: >
TOSCA simple profile with nodejs and mongodb.
imports:
- ../../toscalib/tests/data/custom_types/nodejs.yaml
- custom_types/nodejs.yaml
dsl_definitions:
ubuntu_node: &ubuntu_node