]> arthur.barton.de Git - bup.git/blobdiff - test/ext/test_prune_older.py
Drop vestigial compat.items
[bup.git] / test / ext / test_prune_older.py
index fd44fdf7263c09bdd939c57c6ecbd46b994609ca..36e19633587adbeff5323576d4c33cc2ffea21a2 100644 (file)
@@ -61,7 +61,7 @@ def expected_retentions(utcs, utc_start, spec):
         return utcs
     utcs = sorted(utcs, reverse=True)
     period_start = dict(spec)
-    for kind, duration in compat.items(period_start):
+    for kind, duration in period_start.items():
         period_start[kind] = utc_start - period_as_secs(duration)
     period_start = defaultdict(lambda: float('inf'), period_start)
 
@@ -158,14 +158,15 @@ def test_prune_older(tmpdir):
     three_years_ago = now - (60 * 60 * 24 * 366 * 3)
     chdir(tmpdir)
     ex([b'git', b'init', b'work'])
+    ex([b'git', b'symbolic-ref', b'HEAD', b'refs/heads/main'])
     ex([b'git', b'config', b'gc.autoDetach', b'false'])
 
     wvstart('generating ' + str(save_population) + ' random saves')
     chdir(tmpdir + b'/work')
     save_utcs = create_older_random_saves(save_population, three_years_ago, now)
     chdir(tmpdir)
-    test_set_hash = exo([b'git', b'show-ref', b'-s', b'master']).out.rstrip()
-    ls_saves = exo((bup_cmd, b'ls', b'master')).out.splitlines()
+    test_set_hash = exo([b'git', b'show-ref', b'-s', b'main']).out.rstrip()
+    ls_saves = exo((bup_cmd, b'ls', b'main')).out.splitlines()
     wvpasseq(save_population + 1, len(ls_saves))
 
     wvstart('ensure everything kept, if no keep arguments')
@@ -173,7 +174,7 @@ def test_prune_older(tmpdir):
     proc = ex((bup_cmd,
                b'prune-older', b'-v', b'--unsafe', b'--no-gc',
                b'--wrt', b'%d' % now) \
-              + (b'master',),
+              + (b'main',),
               stdout=None, stderr=PIPE, check=False)
     wvpassne(proc.rc, 0)
     wvpass(b'at least one keep argument is required' in proc.err)
@@ -193,7 +194,7 @@ def test_prune_older(tmpdir):
             b'prune-older', b'-v', b'--unsafe', b'--no-gc', b'--wrt',
             b'%d' % now) \
            + period_spec_to_period_args(spec) \
-           + (b'master',))
+           + (b'main',))
         check_prune_result(expected)
 
 
@@ -213,5 +214,5 @@ def test_prune_older(tmpdir):
         ex((bup_cmd,
             b'prune-older', b'-v', b'--unsafe', b'--wrt', b'%d' % now) \
            + period_spec_to_period_args(spec) \
-           + (b'master',))
+           + (b'main',))
         check_prune_result(expected)