X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0514b290f5ff9a2700b599bf6fb19a468a73c3fb..65622f423c2ee35250856657b06118481d53edc8:/sdk/python/tests/test_arv_copy.py diff --git a/sdk/python/tests/test_arv_copy.py b/sdk/python/tests/test_arv_copy.py index e291ee05f2..54fed8573e 100644 --- a/sdk/python/tests/test_arv_copy.py +++ b/sdk/python/tests/test_arv_copy.py @@ -1,16 +1,13 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import io +from __future__ import absolute_import import os import sys import tempfile import unittest import arvados.commands.arv_copy as arv_copy -import arvados_testutil as tutil +from . import arvados_testutil as tutil -class ArvCopyTestCase(unittest.TestCase): +class ArvCopyTestCase(unittest.TestCase, tutil.VersionChecker): def run_copy(self, args): sys.argv = ['arv-copy'] + args return arv_copy.main() @@ -20,10 +17,8 @@ class ArvCopyTestCase(unittest.TestCase): self.run_copy(['-x=unknown']) def test_version_argument(self): - err = io.BytesIO() - out = io.BytesIO() - with tutil.redirected_streams(stdout=out, stderr=err): + with tutil.redirected_streams( + stdout=tutil.StringIO, stderr=tutil.StringIO) as (out, err): with self.assertRaises(SystemExit): self.run_copy(['--version']) - self.assertEqual(out.getvalue(), '') - self.assertRegexpMatches(err.getvalue(), "[0-9]+\.[0-9]+\.[0-9]+") + self.assertVersionOutput(out, err)