[Calypso-commits] [calypso] 04/07: Test item removal

Guido Guenther agx at moszumanska.debian.org
Thu Jun 22 13:28:25 UTC 2017


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to branch master
in repository calypso.

commit 7eac41bb4ff12fa47833d9e77e7a725f1d169d8d
Author: Guido Günther <agx at sigxcpu.org>
Date:   Sat Apr 8 20:54:56 2017 +0200

    Test item removal
---
 tests/test_collection.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tests/test_collection.py b/tests/test_collection.py
index 26612e4..62a8d0a 100644
--- a/tests/test_collection.py
+++ b/tests/test_collection.py
@@ -22,6 +22,21 @@ class TestCollection(CalypsoTestCase):
         org = u'Universitetet i Tromsø'
         self.assertEquals(org, collection.items[0].object.org.value[0])
 
+    def test_remove_existent_item(self):
+        collection = Collection("")
+        self.assertTrue(collection.import_file(self.test_vcard))
+        self.assertEqual(len(collection.items), 2)
+        name = collection.items[0].name
+        collection.remove(name, {})
+        self.assertEqual(len(collection.items), 1)
+
+    def test_remove_nonexistent_item(self):
+        collection = Collection("")
+        self.assertTrue(collection.import_file(self.test_vcard))
+        self.assertEqual(len(collection.items), 2)
+        collection.remove("doesnotexist", {})
+        self.assertEqual(len(collection.items), 2)
+
     def test_uid_with_slash(self):
         collection = Collection("/")
         self.assertTrue(collection.import_file(self.test_resource_with_slash))
@@ -31,3 +46,4 @@ class TestCollection(CalypsoTestCase):
         c = paths.collection_from_path(veventuid)
         self.assertEquals(r, veventuid)
         self.assertEquals("/", c)
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/calypso/calypso.git



More information about the Calypso-commits mailing list