Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: tests/test_rpy.py

Issue 30053555: Issue 7471 - Add an API for working with blocks of filters (Closed) Base URL: https://hg.adblockplus.org/python-abp
Patch Set: Refine the API and add documentation Created May 9, 2019, 11:13 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« abp/filters/rpy.py ('K') | « tests/test_filters_blocks.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
"""
« abp/filters/rpy.py ('K') | « tests/test_filters_blocks.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld