projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.curoverse.com:arvados into 11876-r-sdk
[arvados.git]
/
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 e291ee05f2ed07b0635cc6c8b5374b0fdecb11ba..324d6e05d7704b810d7975980c2c48d7f39e37d9 100644
(file)
--- a/
sdk/python/tests/test_arv_copy.py
+++ b/
sdk/python/tests/test_arv_copy.py
@@
-1,16
+1,17
@@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
-import io
+from __future__ import absolute_import
import os
import sys
import tempfile
import unittest
import arvados.commands.arv_copy as arv_copy
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()
def run_copy(self, args):
sys.argv = ['arv-copy'] + args
return arv_copy.main()
@@
-20,10
+21,8
@@
class ArvCopyTestCase(unittest.TestCase):
self.run_copy(['-x=unknown'])
def test_version_argument(self):
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'])
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)