Exemplo n.º 1
0
    def test_select_classes_when_no_complex_class_available(self):
        classes = [
            ClassFactory.enumeration(2),
            ClassFactory.create(type=SimpleType)
        ]
        container = ClassContainer.from_list(classes)

        self.assertEqual(classes, ClassAnalyzer.select_classes(container))
Exemplo n.º 2
0
    def test_select_classes(self, mock_validate_references):
        classes = [
            ClassFactory.create(strict_type=True, type=ComplexType),
            ClassFactory.create(type=Element),
            ClassFactory.create(type=ComplexType),
            ClassFactory.create(type=SimpleType),
            ClassFactory.enumeration(2),
        ]

        container = ClassContainer.from_list(classes)

        expected = [
            classes[1],
            classes[2],
            classes[4],
        ]

        self.assertEqual(expected, ClassAnalyzer.select_classes(container))
        mock_validate_references.assert_called_once_with(expected)