Пример #1
0
    def test_enumcomma_stringlist_parameter(self):
        p = params.EnumCommaDelimStringListParameter(name='test1', description='test1_description', is_required=False, enum_values=['value1', 'value2'])

        test_matrix = [
            ('value1', ['value1']),
            ('value1,value2', ['value1', 'value2']),
            ('value1 , value2', ['value1', 'value2']),
            ('value1, value2', ['value1', 'value2']),
            ('value1, value2, value1', ['value1', 'value2', 'value1']),
            ('value3', False),
            (' ', False),
            ('', False)
        ]

        self.run_matrix_test(test_matrix, p)
Пример #2
0
    def test_enumcomma_stringlist_parameter(self):
        p = params.EnumCommaDelimStringListParameter(
            name="test1",
            description="test1_description",
            is_required=False,
            enum_values=["value1", "value2"],
        )

        test_matrix = [
            ("value1", ["value1"]),
            ("value1,value2", ["value1", "value2"]),
            ("value1 , value2", ["value1", "value2"]),
            ("value1, value2", ["value1", "value2"]),
            ("value1, value2, value1", ["value1", "value2", "value1"]),
            ("value3", False),
            (" ", False),
            ("", False),
        ]

        self.run_matrix_test(test_matrix, p)