--- /dev/null
+BEGIN:VCARD
+VERSION:4.0
+N:Gump;Forrest;;;
+FN:Forrest Gump
+ORG:Bubba Gump Shrimp Co.
+TITLE:Shrimp Man
+PHOTO;MEDIATYPE=image/gif:http://www.example.com/dir_photos/my_photo.gif
+TEL;TYPE=work,voice;VALUE=uri:tel:+11115551212
+TEL;TYPE=home,voice;VALUE=uri:tel:+14045551212
+ADR;TYPE=work;LABEL="100 Waters Edge\nBaytown, LA 30314\nUnited States of A
+ merica":;;100 Waters Edge;Baytown;LA;30314;United States of America
+ADR;TYPE=home;LABEL="42 Plantation St.\nBaytown, LA 30314\nUnited States of
+ America":;;42 Plantation St.;Baytown;LA;30314;United States of America
+EMAIL:forrestgump@example.com
+REV:20080424T195243Z
+END:VCARD
+
--- /dev/null
+# vim: set fileencoding=utf-8 :
+"""Test L{gbp.command_wrappers.Command}'s tarball unpack"""
+
+import os
+import subprocess
+import tempfile
+import shutil
+import unittest
+
+import calypso.config
+from calypso.webdav import Collection
+
+
+class TestCollection(unittest.TestCase):
+ test_vcard = "tests/data/import.vcard"
+
+ def setUp(self):
+ self.tmpdir = tempfile.mkdtemp()
+ calypso.config.set('storage', 'folder', self.tmpdir)
+ subprocess.call(["git", "init", self.tmpdir]),
+
+ def tearDown(self):
+ if self.tmpdir:
+ shutil.rmtree(self.tmpdir)
+
+ def test_import_file(self):
+ collection = Collection("")
+ self.assertTrue(collection.import_file(self.test_vcard))
+ self.assertEqual(len(collection.items), 1)