Beispiel #1
0
def test_rex_predicate():
    m = freeze({'foo': {'bar': {'baz': 1}, 'bof': {'baz': 1}}})
    assert m.transform(['foo', rex('^bo.*'), 'baz'], inc) == {
        'foo': {
            'bar': {
                'baz': 1
            },
            'bof': {
                'baz': 2
            }
        }
    }
Beispiel #2
0
def test_rex_with_non_string_key():
    m = freeze({'foo': 1, 5: 2})
    assert m.transform([rex(".*")], 5) == {'foo': 5, 5: 2}
Beispiel #3
0
def test_rex_with_non_string_key():
    m = freeze({'foo': 1, 5: 2})
    assert m.transform([rex(".*")], 5) == {'foo': 5, 5: 2}
Beispiel #4
0
def test_rex_predicate():
    m = freeze({'foo': {'bar': {'baz': 1},
                        'bof': {'baz': 1}}})
    assert m.transform(['foo', rex('^bo.*'), 'baz'], inc) == {'foo': {'bar': {'baz': 1},
                                                                      'bof': {'baz': 2}}}
Beispiel #5
0
def test_rex_redicate():
    m = freeze({"foo": {"bar": {"baz": 1}, "bof": {"baz": 1}}})
    assert m.transform(["foo", rex("^bo.*"), "baz"], inc) == {"foo": {"bar": {"baz": 1}, "bof": {"baz": 2}}}