Ejemplo n.º 1
0
 def test_pythonObjectFromYamlParsingShouldBeTheSameAsJsonParsing(self):
     # Given
     json_path = findRelativePathFor(
         "tests/integration/data/test-parsing.json")
     yaml_path = findRelativePathFor(
         "tests/integration/data/test-parsing.yml")
     # When
     json_data = json.load(open(json_path))
     yaml_data = yaml.load(open(yaml_path))
     # Then
     self.assertEqual(
         json_data, yaml_data,
         'Error : python object made from json parsing is different from yaml parsing'
     )
Ejemplo n.º 2
0
    def test_is_image_ready_to_publish_returns_false_when_status_is_cancelled(self):
        # given
        image = self.build_image_to_publish("cancelled", False, self.app_uri)
        file = findRelativePathFor("tests/integration/data/publish_builder.yml")
        builder = self.build_builder(file)

        # when
        image_ready = is_image_ready_to_publish(image, builder)

        # then
        self.assertEqual(image_ready, False)
Ejemplo n.º 3
0
    def test_is_image_ready_to_publish_returns_true_when_memory_and_swap_size_are_defined(self):
        # given
        image = self.build_image_to_publish("complete", True, self.app_uri)
        file = findRelativePathFor("tests/integration/data/publish_builder.yml")
        builder = self.build_builder(file)

        # when
        image_ready = is_image_ready_to_publish(image, builder)

        # then
        self.assertEqual(image_ready, True)
Ejemplo n.º 4
0
    def testbuild_deployment_azure_returns_None_when_file_incomplete(self):
        # Given
        file = findRelativePathFor("tests/integration/data/deploy_azure_incomplete.yml")

        # When
        try:
            check_and_get_attributes_from_file(file, ["name", "userName"])
        except ValueError:
            return

        #Then
        self.fail(self)
Ejemplo n.º 5
0
    def test_build_deployment_openstack_returns_None_when_file_incomplete(self):
        # Given
        file = findRelativePathFor("tests/integration/data/deploy_openstack_incomplete.yml")

        # When
        try:
            check_and_get_attributes_from_file(file, ["name", "region", "network", "flavor"])
        except ValueError:
            return

        #Then
        self.fail(self)
Ejemplo n.º 6
0
    def testbuild_deployment_azure_returns_None_when_file_incomplete(self):
        # Given
        file = findRelativePathFor(
            "tests/integration/data/deploy_azure_incomplete.yml")

        # When
        try:
            check_and_get_attributes_from_file(file, ["name", "userName"])
        except ValueError:
            return

        #Then
        self.fail(self)
Ejemplo n.º 7
0
    def test_build_deployment_openstack_returns_None_when_file_incomplete(
            self):
        # Given
        file = findRelativePathFor(
            "tests/integration/data/deploy_openstack_incomplete.yml")

        # When
        try:
            check_and_get_attributes_from_file(
                file, ["name", "region", "network", "flavor"])
        except ValueError:
            return

        #Then
        self.fail(self)
Ejemplo n.º 8
0
 def prepare_image_deploy_command_aws(self, id):
      args = "--file %s --publish-id %s" % (findRelativePathFor("tests/integration/data/deploy_aws.yml"), id)
      return args
Ejemplo n.º 9
0
 def prepare_image_deploy_command_aws(self, id):
     args = "--file %s --publish-id %s" % (
         findRelativePathFor("tests/integration/data/deploy_aws.yml"), id)
     return args