def test__create_complex_properties_from_classes(self): """ Test the `_create_complex_properties_from_classes` method. """ schema = Schema(Mock()) mock_complex = Mock() schema._create_complex_properties_from_class = mock_complex schema._create_complex_properties_from_classes(list("Test!")) self.assertEqual(mock_complex.call_count, 5)
def test_create(self): """ Test the `create` method. """ schema = Schema(Mock()) # mock function calls mock_primitive = Mock() mock_complex = Mock() schema._create_classes_with_primitives = mock_primitive schema._create_complex_properties_from_classes = mock_complex schema.create("test/schema/schema_company.json") # with read from file mock_primitive.assert_called_with(schema_company_local["classes"]) mock_complex.assert_called_with(schema_company_local["classes"])