コード例 #1
0
ファイル: test_predicate.py プロジェクト: ozonru/mbtest
def test_invalid_operator():
    expected_predicate = Predicate(operator="deepEquals")
    predicate_structure = expected_predicate.as_structure()
    # Adds another operator
    predicate_structure["equals"] = {}
    with pytest.raises(Predicate.InvalidPredicateOperator):
        Predicate.from_structure(predicate_structure)
コード例 #2
0
def test_default_predicate():
    # Given
    predicate = Predicate()

    # When
    structure = predicate.as_structure()

    # Then
    assert_that(structure, has_entries(caseSensitive=True, equals=has_entries()))
コード例 #3
0
ファイル: test_predicate.py プロジェクト: ozonru/mbtest
def test_structure_xpath():
    expected_predicate = Predicate(xpath="darwin")
    predicate_structure = expected_predicate.as_structure()
    predicate = BasePredicate.from_structure(predicate_structure)
    assert predicate.xpath == expected_predicate.xpath
コード例 #4
0
ファイル: test_predicate.py プロジェクト: ozonru/mbtest
def test_structure_operator():
    expected_predicate = Predicate(operator="deepEquals")
    predicate_structure = expected_predicate.as_structure()
    predicate = BasePredicate.from_structure(predicate_structure)
    assert predicate.operator == expected_predicate.operator
コード例 #5
0
ファイル: test_predicate.py プロジェクト: ozonru/mbtest
def test_structure_headers():
    expected_predicate = Predicate(headers={"key": "value"})
    predicate_structure = expected_predicate.as_structure()
    predicate = BasePredicate.from_structure(predicate_structure)
    assert predicate.headers == expected_predicate.headers
コード例 #6
0
ファイル: test_predicate.py プロジェクト: ozonru/mbtest
def test_structure_query():
    expected_predicate = Predicate(query={"key": "value"})
    predicate_structure = expected_predicate.as_structure()
    predicate = BasePredicate.from_structure(predicate_structure)
    assert predicate.query == expected_predicate.query
コード例 #7
0
ファイル: test_predicate.py プロジェクト: ozonru/mbtest
def test_structure_method():
    expected_predicate = Predicate(method="GET")
    predicate_structure = expected_predicate.as_structure()
    predicate = BasePredicate.from_structure(predicate_structure)
    assert predicate.method == expected_predicate.method
コード例 #8
0
ファイル: test_predicate.py プロジェクト: ozonru/mbtest
def test_structure_body():
    expected_predicate = Predicate(body="darwin")
    predicate_structure = expected_predicate.as_structure()
    predicate = BasePredicate.from_structure(predicate_structure)
    assert predicate.body == expected_predicate.body
コード例 #9
0
ファイル: test_predicate.py プロジェクト: ozonru/mbtest
def test_structure_path():
    expected_predicate = Predicate(path="/darwin")
    predicate_structure = expected_predicate.as_structure()
    predicate = BasePredicate.from_structure(predicate_structure)
    assert_that(predicate, instance_of(Predicate))
    assert predicate.path == expected_predicate.path
コード例 #10
0
def test_structure_path():
    expected_predicate = Predicate(path="/darwin")
    predicate_structure = expected_predicate.as_structure()
    predicate = Predicate.from_structure(predicate_structure)
    assert predicate.path == expected_predicate.path