]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/t/txstat.py
get: adjust for python 3 and test there
[bup.git] / lib / bup / t / txstat.py
index 33d4341649d7b35e366418aef8cd63470596d832..d002a36db3ad17ee9fb2fef5b380466041ef1dc1 100644 (file)
@@ -1,3 +1,5 @@
+
+from __future__ import absolute_import
 import math, tempfile, subprocess
 
 from wvtest import *
@@ -63,10 +65,10 @@ def test_bup_utimensat():
     if not xstat._bup_utimensat:
         return
     with no_lingering_errors():
-        with test_tempdir('bup-txstat-') as tmpdir:
-            path = tmpdir + '/foo'
+        with test_tempdir(b'bup-txstat-') as tmpdir:
+            path = tmpdir + b'/foo'
             open(path, 'w').close()
-            frac_ts = (0, 10**9 / 2)
+            frac_ts = (0, 10**9 // 2)
             xstat._bup_utimensat(_helpers.AT_FDCWD, path, (frac_ts, frac_ts), 0)
             st = _helpers.stat(path)
             atime_ts = st[8]
@@ -82,10 +84,10 @@ def test_bup_utimes():
     if not xstat._bup_utimes:
         return
     with no_lingering_errors():
-        with test_tempdir('bup-txstat-') as tmpdir:
-            path = tmpdir + '/foo'
+        with test_tempdir(b'bup-txstat-') as tmpdir:
+            path = tmpdir + b'/foo'
             open(path, 'w').close()
-            frac_ts = (0, 10**6 / 2)
+            frac_ts = (0, 10**6 // 2)
             xstat._bup_utimes(path, (frac_ts, frac_ts))
             st = _helpers.stat(path)
             atime_ts = st[8]
@@ -101,10 +103,10 @@ def test_bup_lutimes():
     if not xstat._bup_lutimes:
         return
     with no_lingering_errors():
-        with test_tempdir('bup-txstat-') as tmpdir:
-            path = tmpdir + '/foo'
+        with test_tempdir(b'bup-txstat-') as tmpdir:
+            path = tmpdir + b'/foo'
             open(path, 'w').close()
-            frac_ts = (0, 10**6 / 2)
+            frac_ts = (0, 10**6 // 2)
             xstat._bup_lutimes(path, (frac_ts, frac_ts))
             st = _helpers.stat(path)
             atime_ts = st[8]