示例#1
0
def test_parse_converts_page_into_parsedpage(page_fixture):
    """Test parser.parse converts a Page into a ParsedPage."""
    test_page = page_fixture
    test_parsedpage = parser.parse(test_page)
    expected_repr = "<class 'parker.parsedpage.ParsedPage'>(%s)" % (
        test_page.uri
    )

    assert isinstance(test_parsedpage, parsedpage.ParsedPage)
    assert test_parsedpage.__repr__() == expected_repr
示例#2
0
def parsedpage_fixture(page_fixture):
    """Test fixture to ensure correct mocking for parsedpage."""
    test_page = page_fixture
    return parser.parse(test_page)
示例#3
0
def test_parse_throws_typeerror_wrong_input():
    """Test parser.parse throws a TypeError on the wrong input."""
    with pytest.raises(TypeError):
        test_parsedpage = parser.parse(None)