1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
9 from arvados import _internal
13 @_internal.deprecated('TestVersion', 'arvados.noop')
17 This function returns None.
20 @pytest.mark.parametrize('pattern', [
22 r'^ *.. WARNING:: Deprecated$',
23 r' removed in Arvados TestVersion\.',
24 r' Prefer arvados\.noop\b',
25 r'^ *This function returns None\.$',
27 def test_docstring(self, pattern):
28 assert re.search(pattern, self.noop_func.__doc__, re.MULTILINE) is not None
30 def test_deprecation_warning(self):
31 with pytest.warns(DeprecationWarning) as check:
33 actual = str(check[0].message)
34 assert ' removed in Arvados TestVersion.' in actual
35 assert ' Prefer arvados.noop ' in actual
39 @pytest.mark.parametrize('s', [
44 def test_default_split(self, s):
45 assert list(_internal.parse_seq(s)) == ['foo', 'bar']
47 @pytest.mark.parametrize('s', [
55 def test_empty_filtering(self, s):
56 assert list(_internal.parse_seq(s)) == ['foo']
58 @pytest.mark.parametrize('s', [
64 def test_empty_list(self, s):
65 assert list(_internal.parse_seq(s)) == []
69 @pytest.mark.parametrize('arg', [
73 'ababcbabcdcbabcdedcbae',
75 def test_uniq(self, arg):
76 assert list(_internal.uniq(iter(arg))) == list('abcde')