예제 #1
0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from helpers import setup_path

setup_path()

from caper import Matcher
from matchers import matches_dict
from helpers import create_fragments
from hamcrest import assert_that, none
import pytest


def test_matcher_construction():
    matcher = Matcher([('test', [(1.0, [()]), (1.0, [
        (r'^abc$', r'^1234$'),
    ])]), ('test3', [
        (r'(?P<resolution>%s)', ['480p', '720p', '1080p']),
    ])])
예제 #2
0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


from helpers import setup_path
setup_path()

import pytest
from matchers import MatchesDict


def test_has_info():
    pass


def test_matches_dict():
    assert MatchesDict.recursive_match({'one': 1}, {'one': 1}) is True

    assert MatchesDict.recursive_match({'one': 1}, {'one': 2}) is False
    assert MatchesDict.recursive_match({'one': 2}, {'one': 1}) is False