Fix tests usage of umask
This commit is contained in:
parent
11b44556fc
commit
49dfffabb0
|
@ -112,7 +112,7 @@ class MagicFolderCLITestMixin(CLITestMixin, GridTestMixin):
|
||||||
def init_magicfolder(self, client_num, upload_dircap, collective_dircap, local_magic_dir, clock):
|
def init_magicfolder(self, client_num, upload_dircap, collective_dircap, local_magic_dir, clock):
|
||||||
dbfile = abspath_expanduser_unicode(u"magicfolderdb.sqlite", base=self.get_clientdir(i=client_num))
|
dbfile = abspath_expanduser_unicode(u"magicfolderdb.sqlite", base=self.get_clientdir(i=client_num))
|
||||||
magicfolder = MagicFolder(self.get_client(client_num), upload_dircap, collective_dircap, local_magic_dir,
|
magicfolder = MagicFolder(self.get_client(client_num), upload_dircap, collective_dircap, local_magic_dir,
|
||||||
dbfile, pending_delay=0.2, clock=clock)
|
dbfile, 0077, pending_delay=0.2, clock=clock)
|
||||||
magicfolder.downloader._turn_delay = 0
|
magicfolder.downloader._turn_delay = 0
|
||||||
|
|
||||||
magicfolder.setServiceParent(self.get_client(client_num))
|
magicfolder.setServiceParent(self.get_client(client_num))
|
||||||
|
|
|
@ -1089,23 +1089,23 @@ class MockTest(MagicFolderTestMixin, unittest.TestCase):
|
||||||
readonly_dircap = n.get_readonly_uri()
|
readonly_dircap = n.get_readonly_uri()
|
||||||
|
|
||||||
self.shouldFail(AssertionError, 'nonexistent local.directory', 'there is no directory',
|
self.shouldFail(AssertionError, 'nonexistent local.directory', 'there is no directory',
|
||||||
MagicFolder, client, upload_dircap, '', doesnotexist, magicfolderdb)
|
MagicFolder, client, upload_dircap, '', doesnotexist, magicfolderdb, 0077)
|
||||||
self.shouldFail(AssertionError, 'non-directory local.directory', 'is not a directory',
|
self.shouldFail(AssertionError, 'non-directory local.directory', 'is not a directory',
|
||||||
MagicFolder, client, upload_dircap, '', not_a_dir, magicfolderdb)
|
MagicFolder, client, upload_dircap, '', not_a_dir, magicfolderdb, 0077)
|
||||||
self.shouldFail(AssertionError, 'bad upload.dircap', 'does not refer to a directory',
|
self.shouldFail(AssertionError, 'bad upload.dircap', 'does not refer to a directory',
|
||||||
MagicFolder, client, 'bad', '', errors_dir, magicfolderdb)
|
MagicFolder, client, 'bad', '', errors_dir, magicfolderdb, 0077)
|
||||||
self.shouldFail(AssertionError, 'non-directory upload.dircap', 'does not refer to a directory',
|
self.shouldFail(AssertionError, 'non-directory upload.dircap', 'does not refer to a directory',
|
||||||
MagicFolder, client, 'URI:LIT:foo', '', errors_dir, magicfolderdb)
|
MagicFolder, client, 'URI:LIT:foo', '', errors_dir, magicfolderdb, 0077)
|
||||||
self.shouldFail(AssertionError, 'readonly upload.dircap', 'is not a writecap to a directory',
|
self.shouldFail(AssertionError, 'readonly upload.dircap', 'is not a writecap to a directory',
|
||||||
MagicFolder, client, readonly_dircap, '', errors_dir, magicfolderdb)
|
MagicFolder, client, readonly_dircap, '', errors_dir, magicfolderdb, 0077)
|
||||||
self.shouldFail(AssertionError, 'collective dircap', 'is not a readonly cap to a directory',
|
self.shouldFail(AssertionError, 'collective dircap', 'is not a readonly cap to a directory',
|
||||||
MagicFolder, client, upload_dircap, upload_dircap, errors_dir, magicfolderdb)
|
MagicFolder, client, upload_dircap, upload_dircap, errors_dir, magicfolderdb, 0077)
|
||||||
|
|
||||||
def _not_implemented():
|
def _not_implemented():
|
||||||
raise NotImplementedError("blah")
|
raise NotImplementedError("blah")
|
||||||
self.patch(magic_folder, 'get_inotify_module', _not_implemented)
|
self.patch(magic_folder, 'get_inotify_module', _not_implemented)
|
||||||
self.shouldFail(NotImplementedError, 'unsupported', 'blah',
|
self.shouldFail(NotImplementedError, 'unsupported', 'blah',
|
||||||
MagicFolder, client, upload_dircap, '', errors_dir, magicfolderdb)
|
MagicFolder, client, upload_dircap, '', errors_dir, magicfolderdb, 0077)
|
||||||
d.addCallback(_check_errors)
|
d.addCallback(_check_errors)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue