From: Zooko O'Whielacronx Date: Tue, 9 Aug 2011 21:59:13 +0000 (-0700) Subject: drop-upload: unit tests for the configuration options being named "cap" instead of... X-Git-Url: https://git.rkrishnan.org/something?a=commitdiff_plain;h=720bc2433b9bd16db1bfc29da03990c385c867e2;p=tahoe-lafs%2Ftahoe-lafs.git drop-upload: unit tests for the configuration options being named "cap" instead of "uri" 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 --- diff --git a/src/allmydata/test/test_drop_upload.py b/src/allmydata/test/test_drop_upload.py index 74cdbe09..ab403a76 100644 --- a/src/allmydata/test/test_drop_upload.py +++ b/src/allmydata/test/test_drop_upload.py @@ -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