Index: tests/test_rpy.py |
=================================================================== |
--- a/tests/test_rpy.py |
+++ b/tests/test_rpy.py |
@@ -15,17 +15,17 @@ |
"""Functional tests for testing rPython integration.""" |
from __future__ import unicode_literals |
from collections import namedtuple |
import pytest |
import sys |
-from abp.filters.rpy import tuple2dict, line2dict, lines2dicts |
+from abp.filters.rpy import line2dict, lines2dicts |
_SAMPLE_TUPLE = namedtuple('tuple', 'foo,bar') |
_TEST_EXAMPLES = { |
'header': { |
'in': b'[Adblock Plus 2.0]', |
'out': { |
@@ -130,31 +130,16 @@ |
check_data_utf8(value) |
elif isinstance(data, (list, tuple)): |
for item in data: |
check_data_utf8(item) |
elif isinstance(data, type('')): |
raise AssertionError('{} is str. Expected bytes.'.format(data)) |
-@pytest.mark.parametrize('foo,bar', [ |
Vasily Kuznetsov
2019/05/09 11:18:59
The code that's tested here is now in `parser.py`
|
- ('test_foo', 1), |
- ({'foofoo': 'test', 'foobar': 2}, [1, 2, 3]), |
- ((1,), [('a', True), ('b', False)]), |
-]) |
-def test_tuple2dict(foo, bar): |
- """Test that dicts are produced correctly from a named tuple.""" |
- data = _SAMPLE_TUPLE(foo=foo, bar=bar) |
- exp = {'foo': foo, 'bar': bar, 'type': 'tuple'} |
- |
- result = tuple2dict(data) |
- |
- assert exp == result |
- |
- |
@pytest.mark.skipif(sys.version.startswith('3.'), reason='Redundant on py3+.') |
@pytest.mark.parametrize('line_type', _TEST_EXAMPLES.keys()) |
def test_line2dict_encoding(line_type): |
"""Test that the resulting object has all strings encoded as utf-8. |
These tests will only be run on Python2.*. On Python3.*, these test |
cases are covered by test_line2dict() below. |
""" |