소스 검색

removed print statement from transfer_cmd

bigtedde 1 년 전
부모
커밋
7fea384fa7
2개의 변경된 파일7개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 0
      src/borg/testsuite/archiver/debug_cmds.py
  2. 4 6
      src/borg/testsuite/archiver/transfer_cmd.py

+ 3 - 0
src/borg/testsuite/archiver/debug_cmds.py

@@ -18,6 +18,7 @@ def test_debug_profile(archivers, request):
     archiver = request.getfixturevalue(archivers)
     repo_location, input_path = archiver.repository_location, archiver.input_path
     create_test_files(input_path)
+
     cmd(archiver, f"--repo={repo_location}", "rcreate", RK_ENCRYPTION)
     cmd(archiver, f"--repo={repo_location}", "create", "test", "input", "--debug-profile=create.prof")
     cmd(archiver, "debug", "convert-profile", "create.prof", "create.pyprof")
@@ -34,6 +35,7 @@ def test_debug_dump_archive_items(archivers, request):
     archiver = request.getfixturevalue(archivers)
     repo_location, input_path = archiver.repository_location, archiver.input_path
     create_test_files(input_path)
+
     cmd(archiver, f"--repo={repo_location}", "rcreate", RK_ENCRYPTION)
     cmd(archiver, f"--repo={repo_location}", "create", "test", "input")
     with changedir("output"):
@@ -47,6 +49,7 @@ def test_debug_dump_repo_objs(archivers, request):
     archiver = request.getfixturevalue(archivers)
     repo_location, input_path = archiver.repository_location, archiver.input_path
     create_test_files(input_path)
+
     cmd(archiver, f"--repo={repo_location}", "rcreate", RK_ENCRYPTION)
     cmd(archiver, f"--repo={repo_location}", "create", "test", "input")
     with changedir("output"):

+ 4 - 6
src/borg/testsuite/archiver/transfer_cmd.py

@@ -88,11 +88,13 @@ def test_transfer_upgrade(archivers, request):
     got = json.loads(rlist_json)
     with open(os.path.join(dst_dir, "test_meta", "repo_list.json")) as f:
         expected = json.load(f)
+
     for key in "encryption", "repository":
         # some stuff obviously needs to be different, remove that!
         del got[key]
         del expected[key]
     assert len(got["archives"]) == len(expected["archives"])
+
     for got_archive, expected_archive in zip(got["archives"], expected["archives"]):
         del got_archive["id"]
         del expected_archive["id"]
@@ -118,8 +120,6 @@ def test_transfer_upgrade(archivers, request):
         expected = [json.loads(line) for line in lines.splitlines()]
         hardlinks = {}
         for g, e in zip(got, expected):
-            # print(f"exp: {e}\ngot: {g}\n")
-
             # borg 1.2 parseformat uses .get("bsdflags", 0) so the json has 0 even
             # if there were no bsdflags stored in the item.
             # borg 2 parseformat uses .get("bsdflags"), so the json has either an int
@@ -183,13 +183,11 @@ def test_transfer_upgrade(archivers, request):
             # hardlinks referring to same inode have same hlid
             assert hardlinks["tmp/borgtest/hardlink1"] == hardlinks["tmp/borgtest/hardlink2"]
 
-    archiver.repository_path = f"{repo_location}2"
+    repo_path = f"{repo_location}2"
     for archive_name in ("archive1", "archive2"):
-        archive, repository = open_archive(archiver.repository_path, archive_name)
+        archive, repository = open_archive(repo_path, archive_name)
         with repository:
             for item in archive.iter_items():
-                print(item)
-
                 # borg1 used to store some stuff with None values
                 # borg2 does just not have the key if the value is not known.
                 item_dict = item.as_dict()