import json
from twisted.trial import unittest
+from twisted.internet import defer
from allmydata.util import fileutil
from allmydata.scripts.common import get_aliases
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):
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
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):
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):
# 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):