def start(self): """Print what is going to be transferred, initialized self.start_time """ to_print = pprint_transfer(self.src, self.dest) self.fd.write(to_print + "\n") self.start_time = time.time() ProgressBar.start(self)
def test_no_sfx(self): src = "/path/to/foo/a" dest = "/path/to/foo/b" res = pprint_transfer(src, dest) self.assertEquals(res, "/path/to/foo/{a => b}")
def test_03(self): src = "/path/to/foo/a/b" dest = "/path/to/foo/bar/a/b" res = pprint_transfer(src, dest) self.assertEquals(res, "/path/to/foo/{ => bar}/a/b")
def test_no_pfx(self): src = "/path/to/foo/a/b" dest = "/other/a/b" res = pprint_transfer(src, dest) self.assertEquals(res, "{/path/to/foo => /other}/a/b")
def test_01(self): src = "/path/to/foo" dest = "/path/to/bar" res = pprint_transfer(src, dest) self.assertEquals(res, "/path/to/{foo => bar}")
def test_02(self): src = "/path/to/foo/a/b" dest = "/path/to/spam/a/b" res = pprint_transfer(src, dest) self.assertEquals(res, "/path/to/{foo => spam}/a/b")
def test_03(self): src = r"c:\path\to\foo\a\b" dest = r"c:\path\to\foo\bar\a\b" res = pprint_transfer(src, dest) self.assertEquals(res, r"c:\path\to\foo\{ => bar}\a\b")
def test_no_sfx(self): src = r"c:\path\to\foo\a" dest = r"c:\path\to\foo\b" res = pprint_transfer(src, dest) self.assertEquals(res, r"c:\path\to\foo\{a => b}")
def test_no_dir(self): src = "a" dest = "b" res = pprint_transfer(src, dest) self.assertEquals(res, "a => b")
def test_other_drive(self): src = r"c:\path\to\foo\a\b" dest = r"d:\other\a\b" res = pprint_transfer(src, dest) self.assertEquals(res, r"{c:\path\to\foo => d:\other}\a\b")
def test_02(self): src = r"c:\path\to\foo\a\b" dest = r"c:\path\to\spam\a\b" res = pprint_transfer(src, dest) self.assertEquals(res, r"c:\path\to\{foo => spam}\a\b")
def test_01(self): src = r"c:\path\to\foo" dest = r"c:\path\to\bar" res = pprint_transfer(src, dest) self.assertEquals(res, r"c:\path\to\{foo => bar}")