7027: Update merge_test to use SrcAttribute

This commit is contained in:
Nick Hall 2014-05-17 21:53:46 +01:00
parent 28a70926ab
commit b5ad672ace

View File

@ -28,7 +28,8 @@ from .. import (Person, Surname, Name, NameType, Family, FamilyRelType,
StyledText, StyledTextTag, StyledTextTagType, Tag, StyledText, StyledTextTag, StyledTextTagType, Tag,
ChildRef, ChildRefType, Attribute, MediaRef, AttributeType, ChildRef, ChildRefType, Attribute, MediaRef, AttributeType,
Url, UrlType, Address, EventRef, EventRoleType, RepoRef, Url, UrlType, Address, EventRef, EventRoleType, RepoRef,
FamilyRelType, LdsOrd, MediaRef, PersonRef, PlaceType) FamilyRelType, LdsOrd, MediaRef, PersonRef, PlaceType,
SrcAttribute, SrcAttributeType)
from ..privacybase import PrivacyBase from ..privacybase import PrivacyBase
from ..urlbase import UrlBase from ..urlbase import UrlBase
from ..addressbase import AddressBase from ..addressbase import AddressBase
@ -1552,15 +1553,22 @@ class SourceCheck(unittest.TestCase, PrivacyBaseTest, NoteBaseTest,
def todo_test_replace(self): def todo_test_replace(self):
pass pass
@unittest.skip("Blocked by BUG# 7027")
def test_merge_datamap(self): def test_merge_datamap(self):
self.phoenix.set_data_item('A', 'a') attr1 = SrcAttribute()
self.phoenix.set_data_item('B', 'b') attr1.set_type('A')
self.titanic.set_data_item('B', 'bb') attr1.set_value('a')
self.titanic.set_data_item('C', 'c') attr2 = SrcAttribute()
self.ref_obj.set_data_item('A', 'a') attr2.set_type('B')
self.ref_obj.set_data_item('B', 'b') attr2.set_value('b')
self.ref_obj.set_data_item('C', 'c') attr3 = SrcAttribute()
attr3.set_type('B')
attr3.set_value('bb')
attr4 = SrcAttribute()
attr4.set_type('C')
attr4.set_value('c')
self.phoenix.set_attribute_list([attr1, attr2])
self.titanic.set_attribute_list([attr3, attr4])
self.ref_obj.set_attribute_list([attr1, attr2, attr3, attr4])
self.phoenix.merge(self.titanic) self.phoenix.merge(self.titanic)
self.assertEqual(self.phoenix.serialize(), self.ref_obj.serialize()) self.assertEqual(self.phoenix.serialize(), self.ref_obj.serialize())
@ -1743,15 +1751,22 @@ class CitationCheck(unittest.TestCase, PrivacyBaseTest, MediaBaseTest,
self.phoenix.merge(self.titanic) self.phoenix.merge(self.titanic)
self.assertEqual(self.phoenix.serialize(), self.ref_obj.serialize()) self.assertEqual(self.phoenix.serialize(), self.ref_obj.serialize())
@unittest.skip("Blocked by BUG# 7027")
def test_merge_datamap(self): def test_merge_datamap(self):
self.phoenix.set_data_item('A', 'a') attr1 = SrcAttribute()
self.phoenix.set_data_item('B', 'b') attr1.set_type('A')
self.titanic.set_data_item('B', 'bb') attr1.set_value('a')
self.titanic.set_data_item('C', 'c') attr2 = SrcAttribute()
self.ref_obj.set_data_item('A', 'a') attr2.set_type('B')
self.ref_obj.set_data_item('B', 'b') attr2.set_value('b')
self.ref_obj.set_data_item('C', 'c') attr3 = SrcAttribute()
attr3.set_type('B')
attr3.set_value('bb')
attr4 = SrcAttribute()
attr4.set_type('C')
attr4.set_value('c')
self.phoenix.set_attribute_list([attr1, attr2])
self.titanic.set_attribute_list([attr3, attr4])
self.ref_obj.set_attribute_list([attr1, attr2, attr3, attr4])
self.phoenix.merge(self.titanic) self.phoenix.merge(self.titanic)
self.assertEqual(self.phoenix.serialize(), self.ref_obj.serialize()) self.assertEqual(self.phoenix.serialize(), self.ref_obj.serialize())