From: David Stainton Date: Mon, 29 Jun 2015 22:38:07 +0000 (-0700) Subject: fix the rest of the unit tests X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty//%22%3C?a=commitdiff_plain;h=adaf17aa384e37efbd113a06d4f4cbd0577378e5;p=tahoe-lafs%2Ftahoe-lafs.git fix the rest of the unit tests --- diff --git a/src/allmydata/test/test_cli_magic_folder.py b/src/allmydata/test/test_cli_magic_folder.py index c623863a..12e5bde9 100644 --- a/src/allmydata/test/test_cli_magic_folder.py +++ b/src/allmydata/test/test_cli_magic_folder.py @@ -4,6 +4,7 @@ import re import json from twisted.trial import unittest +from twisted.internet import defer from allmydata.util import fileutil from allmydata.scripts.common import get_aliases @@ -95,10 +96,10 @@ class MagicFolderCLITestMixin(CLITestMixin, GridTestMixin): return (rc,stdout,stderr) d.addCallback(_done) def get_alice_caps(x): - alice_collective_dircap, alice_upload_dircap = self.get_caps_from_files(0) + self.collective_dircap, self.upload_dircap = self.get_caps_from_files(0) d.addCallback(get_alice_caps) - d.addCallback(lambda x: self.check_joined_config(0, alice_upload_dircap)) - d.addCallback(lambda x: self.check_config(1, alice_magic_dir)) + d.addCallback(lambda x: self.check_joined_config(0, self.upload_dircap)) + d.addCallback(lambda x: self.check_config(0, local_dir)) return d def cleanup(self, res): diff --git a/src/allmydata/test/test_magic_folder.py b/src/allmydata/test/test_magic_folder.py index df4b96d5..a7adfa8c 100644 --- a/src/allmydata/test/test_magic_folder.py +++ b/src/allmydata/test/test_magic_folder.py @@ -110,7 +110,7 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual d.addCallback(self._made_upload_dir) d.addCallback(self._create_magicfolder) d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.dirs_monitored'), 1)) - d.addBoth(self._cleanup) + d.addBoth(self.cleanup) d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.dirs_monitored'), 0)) return d @@ -191,7 +191,7 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.objects_queued'), 0)) d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.directories_created'), 2)) - d.addBoth(self._cleanup) + d.addBoth(self.cleanup) return d def test_persistence(self): @@ -232,11 +232,11 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual d.addCallback(self._create_magicfolder) d.addCallback(lambda x: time.sleep(1)) - d.addCallback(self._cleanup) + d.addCallback(self.cleanup) d.addCallback(_restart) d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.objects_succeeded'), 0)) d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.objects_queued'), 0)) - d.addBoth(self._cleanup) + d.addBoth(self.cleanup) return d def test_magic_folder(self): @@ -271,7 +271,7 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual # TODO: test that causes an upload failure. d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.files_failed'), 0)) - d.addBoth(self._cleanup) + d.addBoth(self.cleanup) return d def _check_file(self, name_u, data, temporary=False):