def create_test_definition(self,
                               testdef_file,
                               template=TESTDEF_TEMPLATE,
                               steps=None):
        """Creates a test definition YAML file.

        :param testdef_file: The file to create.
        :return The path of the file created.
        """

        print >> sys.stdout, "\nCreating test definition file..."

        testdef = TestDefinition(template, testdef_file)
        if steps:
            steps = to_list(steps)
            testdef.set(TESTDEF_STEPS_KEY, steps)
        testdef.update(self.config)
        testdef.write()

        basename = os.path.basename(testdef.file_name)
        print >> sys.stdout, ("\nCreated test definition "
                              "'{0}'.".format(basename))

        return testdef.file_name
Пример #2
0
 def test_to_list_1(self):
     expected = ["a_value", "b_value"]
     obtained = to_list(expected)
     self.assertIsInstance(obtained, list)
     self.assertEquals(expected, obtained)
Пример #3
0
    def set(self, value):
        """Sets the value of the parameter.

        :param value: The value to set.
        """
        self.value = to_list(value)
Пример #4
0
 def test_to_list_0(self):
     value = "a_value"
     expected = [value]
     obtained = to_list(value)
     self.assertIsInstance(obtained, list)
     self.assertEquals(expected, obtained)
Пример #5
0
 def __init__(self, id, choices):
     super(SingleChoiceParameter, self).__init__(id)
     self.choices = to_list(choices)