Skip to content

Commit 5a3ce13

Browse files
tests/test_cpiofile.py: Fix test to not be skipped for Python2
Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
1 parent 766dfa2 commit 5a3ce13

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/test_cpiofile.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from xcp.cpiofile import CpioFile
1818

19-
from .test_mountingaccessor import binary_data
19+
binary_data = b"\x00\x1b\x5b\x95\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xcc\xdd\xee\xff"
2020

2121

2222
def test_cpiofile_modes(fs):
@@ -33,7 +33,8 @@ def test_cpiofile_modes(fs):
3333
if sys.version_info < (3, 0):
3434
# Test Python2 pattern from host-upgrade-plugin:/etc/xapi.d/plugins/prepare_host_upgrade.py
3535
# Import the Python2-only StringIO.StringIO module, imported as Py2StringIO:
36-
from StringIO import Py2StringIO # pylint: disable=import-outside-toplevel
36+
# pylint: disable-next=import-outside-toplevel
37+
from StringIO import StringIO as Py2StringIO
3738

3839
stringio = Py2StringIO()
3940
archive = CpioFile.open(fileobj=stringio, mode="w|gz") # type: ignore[arg-type]

0 commit comments

Comments
 (0)