Exemplo n.º 1
0
def _fixture(fixture, uri):
    test_page = page.get_instance(
        uri=uri
    )
    test_page.client = fixture

    return test_page
Exemplo n.º 2
0
def test_page_get_instance_creates_page_object():
    """Test page.get_instance creates a Page object."""
    test_page = page.get_instance(TEST_URI)
    expected_repr = "<class 'parker.page.Page'>(%s)" % (TEST_URI)

    assert isinstance(test_page, page.Page) is True
    assert isinstance(test_page.client, client.Client) is True
    assert test_page.__repr__() == expected_repr
Exemplo n.º 3
0
def test_get_instance_creates_page_object():
    """Test page.get_instance creates a Page object."""
    test_page = page.get_instance(TEST_URI)
    expected_repr = "<class 'parker.page.Page'>(%s)" % (
        TEST_URI
    )

    assert isinstance(test_page, page.Page)
    assert isinstance(test_page.client, client.Client)
    assert test_page.__repr__() == expected_repr
Exemplo n.º 4
0
def page_fixture(client_fixture):
    """Test fixture to ensure correct mocking for page."""
    return page.get_instance(
        uri=TEST_URI,
        page_client=client_fixture
    )
Exemplo n.º 5
0
def page_fixture(client_fixture):
    """Test fixture to ensure correct mocking for page."""
    return page.get_instance(uri=TEST_URI, page_client=client_fixture)