]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
drop-upload: unit tests for the configuration options being named "cap" instead of...
authorZooko O'Whielacronx <zooko@zooko.com>
Tue, 9 Aug 2011 21:59:13 +0000 (14:59 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Tue, 9 Aug 2011 21:59:13 +0000 (14:59 -0700)
This is a subset of a patch that David-Sarah attached to #1429. This is just the unit-tests part of that patch, and uses darcs record instead of hunks to change the names.
refs #1429

src/allmydata/test/test_drop_upload.py

index 74cdbe095c3bf34e6029d2914bb75fd0b32565ff..ab403a768621a087bb81aeb0b2b842f5cfde0cde 100644 (file)
@@ -66,8 +66,8 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin):
         def _made_upload_dir(n):
             self.failUnless(IDirectoryNode.providedBy(n))
             self.upload_dirnode = n
-            self.upload_uri = n.get_uri()
-            self.uploader = DropUploader(self.client, self.upload_uri, self.local_dir.encode('utf-8'),
+            self.upload_dircap = n.get_uri()
+            self.uploader = DropUploader(self.client, self.upload_dircap, self.local_dir.encode('utf-8'),
                                          inotify=self.inotify)
             return self.uploader.start()
         d.addCallback(_made_upload_dir)
@@ -162,20 +162,20 @@ class MockTest(DropUploadTestMixin, unittest.TestCase):
         d = client.create_dirnode()
         def _made_upload_dir(n):
             self.failUnless(IDirectoryNode.providedBy(n))
-            upload_uri = n.get_uri()
-            readonly_uri = n.get_readonly_uri()
+            upload_dircap = n.get_uri()
+            readonly_dircap = n.get_readonly_uri()
 
             self.shouldFail(AssertionError, 'invalid local dir', 'could not be represented',
-                            DropUploader, client, upload_uri, '\xFF', inotify=fake_inotify)
+                            DropUploader, client, upload_dircap, '\xFF', inotify=fake_inotify)
             self.shouldFail(AssertionError, 'non-existant local dir', 'not an existing directory',
-                            DropUploader, client, upload_uri, os.path.join(self.basedir, "Laputa"), inotify=fake_inotify)
+                            DropUploader, client, upload_dircap, os.path.join(self.basedir, "Laputa"), inotify=fake_inotify)
 
             self.shouldFail(AssertionError, 'bad URI', 'not a directory URI',
                             DropUploader, client, 'bad', errors_dir, inotify=fake_inotify)
-            self.shouldFail(AssertionError, 'non-directory URI', 'not a directory URI',
+            self.shouldFail(AssertionError, 'non-directory cap', 'does not refer to a directory',
                             DropUploader, client, 'URI:LIT:foo', errors_dir, inotify=fake_inotify)
-            self.shouldFail(AssertionError, 'readonly directory URI', 'does not refer to a writeable directory',
-                            DropUploader, client, readonly_uri, errors_dir, inotify=fake_inotify)
+            self.shouldFail(AssertionError, 'readonly dircap', 'is not a writecap to a directory',
+                            DropUploader, client, readonly_dircap, errors_dir, inotify=fake_inotify)
         d.addCallback(_made_upload_dir)
         return d