is this api less troublesome?

This commit is contained in:
Jean-Paul Calderone 2021-01-12 16:03:28 -05:00
parent 6984f2be3f
commit 43dc85501f
1 changed files with 5 additions and 5 deletions

View File

@ -46,21 +46,21 @@ class Put(GridTestMixin, CLITestMixin, unittest.TestCase):
self.basedir = "cli/Put/unlinked_immutable_from_file" self.basedir = "cli/Put/unlinked_immutable_from_file"
self.set_up_grid(oneshare=True) self.set_up_grid(oneshare=True)
rel_fn = os.path.join(self.basedir, "DATAFILE") rel_fn = unicode(os.path.join(self.basedir, "DATAFILE"))
abs_fn = unicode_to_argv(abspath_expanduser_unicode(unicode(rel_fn))) abs_fn = abspath_expanduser_unicode(rel_fn)
# we make the file small enough to fit in a LIT file, for speed # we make the file small enough to fit in a LIT file, for speed
fileutil.write(rel_fn, "short file") fileutil.write(rel_fn, "short file")
d = self.do_cli("put", rel_fn) d = self.do_cli_unicode(u"put", [rel_fn])
def _uploaded(args): def _uploaded(args):
(rc, out, err) = args (rc, out, err) = args
readcap = out readcap = out
self.failUnless(readcap.startswith("URI:LIT:"), readcap) self.failUnless(readcap.startswith("URI:LIT:"), readcap)
self.readcap = readcap self.readcap = readcap
d.addCallback(_uploaded) d.addCallback(_uploaded)
d.addCallback(lambda res: self.do_cli("put", "./" + rel_fn)) d.addCallback(lambda res: self.do_cli_unicode(u"put", [u"./" + rel_fn]))
d.addCallback(lambda rc_stdout_stderr: d.addCallback(lambda rc_stdout_stderr:
self.failUnlessReallyEqual(rc_stdout_stderr[1], self.readcap)) self.failUnlessReallyEqual(rc_stdout_stderr[1], self.readcap))
d.addCallback(lambda res: self.do_cli("put", abs_fn)) d.addCallback(lambda res: self.do_cli_unicode(u"put", [abs_fn]))
d.addCallback(lambda rc_stdout_stderr: d.addCallback(lambda rc_stdout_stderr:
self.failUnlessReallyEqual(rc_stdout_stderr[1], self.readcap)) self.failUnlessReallyEqual(rc_stdout_stderr[1], self.readcap))
# we just have to assume that ~ is handled properly # we just have to assume that ~ is handled properly