]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
fix the rest of the unit tests
authorDavid Stainton <dstainton415@gmail.com>
Mon, 29 Jun 2015 22:38:07 +0000 (15:38 -0700)
committerDaira Hopwood <daira@jacaranda.org>
Mon, 20 Jul 2015 23:42:34 +0000 (00:42 +0100)
src/allmydata/test/test_cli_magic_folder.py
src/allmydata/test/test_magic_folder.py

index c623863a58137ea1f44938a1f888d263597aaa7e..12e5bde9e0c46debcf7273438829c56726925140 100644 (file)
@@ -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):
index df4b96d5a6a6080e99ae82392dfdfb65d71e6cb5..a7adfa8c053715a7076ea37d924b594d2f7d57f3 100644 (file)
@@ -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):