Changeset 2d8ffdc in trunk


Ignore:
Timestamp:
2014-09-02T19:51:13Z (11 years ago)
Author:
Brian Warner <warner@…>
Branches:
master
Children:
1c96039
Parents:
d81c5e4
git-author:
Mark Berger <mark.berger.j@…> (2013-08-05 13:05:05)
git-committer:
Brian Warner <warner@…> (2014-09-02 19:51:13)
Message:

Adds test_cli.Cp.test_cp_copies_dir

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/allmydata/test/test_cli.py

    rd81c5e4 r2d8ffdc  
    24742474        return d
    24752475
     2476    def test_cp_copies_dir(self):
     2477        # This test ensures that a directory is copied using
     2478        # tahoe cp -r. Refer to ticket #712:
     2479        # https://tahoe-lafs.org/trac/tahoe-lafs/ticket/712
     2480
     2481        self.basedir = "cli/Cp/cp_copies_dir"
     2482        self.set_up_grid()
     2483        subdir = os.path.join(self.basedir, "foo")
     2484        os.mkdir(subdir)
     2485        test1_path = os.path.join(subdir, "test1")
     2486        fileutil.write(test1_path, "test1")
     2487
     2488        d = self.do_cli("create-alias", "tahoe")
     2489        d.addCallback(lambda ign:
     2490            self.do_cli("cp", "-r", subdir, "tahoe:"))
     2491        d.addCallback(lambda ign:
     2492            self.do_cli("ls", "tahoe:"))
     2493        def _check(res, item):
     2494            (rc, out, err) = res
     2495            self.failUnlessEqual(rc, 0)
     2496            self.failUnlessEqual(err, "")
     2497            self.failUnlessIn(item, out, str(res))
     2498        d.addCallback(_check, "foo")
     2499        d.addCallback(lambda ign:
     2500            self.do_cli("ls", "tahoe:foo/"))
     2501        d.addCallback(_check, "test1")
     2502
     2503        d.addCallback(lambda ign: fileutil.rm_dir(subdir))
     2504        d.addCallback(lambda ign: self.do_cli("cp", "-r", "tahoe:foo", self.basedir))
     2505        def _check_local_fs(ign):
     2506            self.failUnless(os.path.isdir(self.basedir))
     2507            self.failUnless(os.path.isfile(test1_path))
     2508        d.addCallback(_check_local_fs)
     2509        return d
    24762510
    24772511class Backup(GridTestMixin, CLITestMixin, StallMixin, unittest.TestCase):
Note: See TracChangeset for help on using the changeset viewer.