def test_define_changes_status(self): root_dto = RootDto() version1 = Version() version1.name = "v1" version1.major = 1 version1 = VersionDto(version1) version2 = Version() version2.name = "v2" version2.major = 2 version2 = VersionDto(version2) category1 = MethodCategory(Category("c1")) category2 = TypeCategory(Category("c2")) method1 = Method() method1.changes_status = {"v1": MultiVersion.Changes.none} method2 = Method() method2.changes_status = {"v1": MultiVersion.Changes.new} method3 = Method() method3.changes_status = {"v2": MultiVersion.Changes.new} category1.methods = [method1, method2, method3] root_dto.versions = [version1, version2] root_dto.method_categories = [category1] root_dto.type_categories = [category2] self.factory.define_changes_status(root_dto) self.assertEqual(MultiVersion.Changes.new, method1.changes_status["v1"]) self.assertEqual(MultiVersion.Changes.deleted, method2.changes_status["v2"]) self.assertEqual(MultiVersion.Changes.none, method3.changes_status["v1"])
def test_define_changes_status__updated(self): root_dto = RootDto() version1 = Version() version1.name = "v1" version1.major = 1 version1 = VersionDto(version1) version2 = Version() version2.name = "v2" version2.major = 2 version2 = VersionDto(version2) category1 = MethodCategory(Category("c1")) method1 = Method() method1.changes_status = {"v1": MultiVersion.Changes.new, "v2": MultiVersion.Changes.updated} category1.methods = [method1] root_dto.versions = [version1, version2] root_dto.method_categories = [category1] self.factory.define_changes_status(root_dto) self.assertEqual(MultiVersion.Changes.new, method1.changes_status["v1"]) self.assertEqual(MultiVersion.Changes.updated, method1.changes_status["v2"])
def test_define_changes_status__updated(self): root_dto = RootDto() version1 = Version() version1.name = "v1" version1.major = 1 version1 = VersionDto(version1) version2 = Version() version2.name = "v2" version2.major = 2 version2 = VersionDto(version2) category1 = MethodCategory(Category("c1")) method1 = Method() method1.changes_status = { "v1": MultiVersion.Changes.new, "v2": MultiVersion.Changes.updated } category1.methods = [method1] root_dto.versions = [version1, version2] root_dto.method_categories = [category1] self.factory.define_changes_status(root_dto) self.assertEqual(MultiVersion.Changes.new, method1.changes_status["v1"]) self.assertEqual(MultiVersion.Changes.updated, method1.changes_status["v2"])
def test_define_changes_status(self): root_dto = RootDto() version1 = Version() version1.name = "v1" version1.major = 1 version1 = VersionDto(version1) version2 = Version() version2.name = "v2" version2.major = 2 version2 = VersionDto(version2) category1 = MethodCategory(Category("c1")) category2 = TypeCategory(Category("c2")) method1 = Method() method1.changes_status = {"v1": MultiVersion.Changes.none} method2 = Method() method2.changes_status = {"v1": MultiVersion.Changes.new} method3 = Method() method3.changes_status = {"v2": MultiVersion.Changes.new} category1.methods = [method1, method2, method3] root_dto.versions = [version1, version2] root_dto.method_categories = [category1] root_dto.type_categories = [category2] self.factory.define_changes_status(root_dto) self.assertEqual(MultiVersion.Changes.new, method1.changes_status["v1"]) self.assertEqual(MultiVersion.Changes.deleted, method2.changes_status["v2"]) self.assertEqual(MultiVersion.Changes.none, method3.changes_status["v1"])