[CalendarServer-changes] [9910] CalendarServer/branches/users/gaya/sharedgroups/txdav/carddav/ datastore/test/test_sql.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Oct 9 13:11:51 PDT 2012
Revision: 9910
http://trac.calendarserver.org//changeset/9910
Author: gaya at apple.com
Date: 2012-10-09 13:11:51 -0700 (Tue, 09 Oct 2012)
Log Message:
-----------
fix test_addressbookObjectUID, test_addressbookObjectKind
Modified Paths:
--------------
CalendarServer/branches/users/gaya/sharedgroups/txdav/carddav/datastore/test/test_sql.py
Modified: CalendarServer/branches/users/gaya/sharedgroups/txdav/carddav/datastore/test/test_sql.py
===================================================================
--- CalendarServer/branches/users/gaya/sharedgroups/txdav/carddav/datastore/test/test_sql.py 2012-10-09 16:36:06 UTC (rev 9909)
+++ CalendarServer/branches/users/gaya/sharedgroups/txdav/carddav/datastore/test/test_sql.py 2012-10-09 20:11:51 UTC (rev 9910)
@@ -30,7 +30,6 @@
from twistedcaldav.vcard import Component as VComponent
from txdav.base.propertystore.base import PropertyName
-from txdav.carddav.datastore.sql import AddressBookObject
from txdav.carddav.datastore.test.common import CommonTests as AddressBookCommonTests, \
vcard4_text
from txdav.carddav.datastore.test.test_file import setUpAddressBookStore
@@ -340,16 +339,10 @@
home = yield txn.homeWithUID(EADDRESSBOOKTYPE, "uid1", create=True)
adbk = yield home.addressbookWithName("addressbook")
- abObject = yield AddressBookObject.objectWithName(adbk, "1.vcf", "badUID")
- self.assertEqual(abObject, None)
-
- abObject = yield AddressBookObject.objectWithName(adbk, "1.vcf", "uid1")
+ abObject = yield adbk.objectResourceWithName("1.vcf")
person = yield abObject.component()
self.assertEqual(person.resourceUID(), "uid1")
- abObject = yield AddressBookObject.objectWithName(adbk, "1.vcf", "badUID")
- self.assertEqual(abObject, None)
-
yield txn.commit()
@@ -425,17 +418,17 @@
home = yield txn.homeWithUID(EADDRESSBOOKTYPE, "uid1", create=True)
adbk = yield home.addressbookWithName("addressbook")
- abObject = yield AddressBookObject.objectWithName(adbk, "p.vcf", "uid1")
+ abObject = yield adbk.objectResourceWithName("p.vcf")
person = yield abObject.component()
self.assertEqual(person.resourceKind(), None)
self.assertEqual(abObject.kind(), _ABO_KIND_PERSON)
- abObject = yield AddressBookObject.objectWithName(adbk, "g.vcf", "uid2")
+ abObject = yield adbk.objectResourceWithName("g.vcf")
group = yield abObject.component()
self.assertEqual(group.resourceKind(), "group")
self.assertEqual(abObject.kind(), _ABO_KIND_GROUP)
- abObject = yield AddressBookObject.objectWithName(adbk, "bg.vcf", "uid3")
+ abObject = yield adbk.objectResourceWithName("bg.vcf")
badgroup = yield abObject.component()
self.assertEqual(badgroup.resourceKind(), "badgroup")
self.assertEqual(abObject.kind(), _ABO_KIND_PERSON)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20121009/7f80eae0/attachment.html>
More information about the calendarserver-changes
mailing list