def test_recover_view_file(self): success = False try: parse_args(["recover", "--view", "/file1"]) except (argparse.ArgumentError, SystemExit): success = True self.assertTrue(success)
def test_recover_extra_files(self): args = parse_args(["recover", "/file1", "/file2", "/file3", "/file4", "/file5", "/file6", "/file7", "/file8", "/file9", "/file10", "/file11"]) expected = [T.Path("/file1"), T.Path("/file2"), T.Path("/file3"), T.Path( "/file4"), T.Path("/file5"), T.Path("/file6"), T.Path("/file7"), T.Path("/file8"), T.Path("/file9"), T.Path("/file10"), T.Path("/file11")] self.assertEqual(args.files, expected)
def test_archive_file_view(self): args = parse_args(["archive", "/file1", "--view"]) self.assertTrue(args.view) success = False try: args.files except AttributeError: success = True self.assertTrue(success)
def test_recover_all_file(self): args = parse_args(["recover", "--all", "/file1"]) self.assertTrue(args.all) success = False try: args.files except AttributeError: success = True self.assertTrue(success)
def test_recover_all(self): args = parse_args(["recover", "--all"]) self.assertTrue(args.all)
def test_recover_view(self): args = parse_args(["recover", "--view"]) self.assertTrue(args.view)
def test_recover(self): args = parse_args(["recover", "/file1", "/file2"]) expected = [T.Path("/file1"), T.Path("/file2")] self.assertEqual(args.files, expected)
def test_archive_view(self): args = parse_args(["archive", "--view"]) self.assertTrue(args.view)
def test_archive(self): args = parse_args(["archive", "/file1", "/file2"]) expected = [T.Path("/file1"), T.Path("/file2")] self.assertEqual(args.files, expected)
def test_keep_view(self): args = parse_args(["keep", "--view"]) self.assertTrue(args.view)
def test_untrack(self): args = parse_args(["untrack", "/file1", "/file2"]) expected = [T.Path("/file1"), T.Path("/file2")] self.assertEqual(args.files, expected)