Source

punkybrowster.work / tests / test_basics.py

from nose import tools

from tests import browser


def test_statuses():
    # TODO: Until we add a test server, this can't test that the
    # TODO: status code is stored right.

    def try_status(file_):
        url = "tests/pages/%s" % file_
        browser.load(url)
        urls = sorted(browser.statuses.iterkeys())
        tools.eq_(len(urls), 2)
        assert urls[0].endswith('notjs.js')
        assert urls[1].endswith(url)
        tools.eq_(browser.statuses.values(), [None, None])

    for file_ in ("test_load.html", "test_load_2.html"):
        yield try_status, file_