Ejemplo n.º 1
0
def test_get_series_info(name, app):
    with app.test_client():
        browser = NaverBrowser()
        browser.session = Mock()
        browser.session.get.side_effect = lambda url, **kwargs: mock_obj(
            url=url, content=read_fixture('{}.html'.format(name)))
        assert (browser.get_series_info(25455) == read_fixture(
            '{}.parsed.yaml'.format(name)))
Ejemplo n.º 2
0
def test_get_series_info(name, app):
    with app.test_client():
        browser = NaverBrowser()
        browser.session = Mock()
        browser.session.get.side_effect = lambda url, **kwargs: mock_obj(
            url=url, content=read_fixture('{}.html'.format(name)))
        assert (browser.get_series_info(25455) ==
                read_fixture('{}.parsed.yaml'.format(name)))
Ejemplo n.º 3
0
def test_get_series_list(app):
    with app.test_client():
        browser = NaverBrowser()
        browser.session = Mock()
        browser.session.get.side_effect = lambda url, **kwargs: mock_obj(
            url=url, content=read_fixture('weekday.nhn.html'))
        assert (browser.get_series_list() == read_fixture(
            'weekday.nhn.parsed.yaml'))
Ejemplo n.º 4
0
def test_get_series_list(app):
    with app.test_client():
        browser = NaverBrowser()
        browser.session = Mock()
        browser.session.get.side_effect = lambda url, **kwargs: mock_obj(
            url=url, content=read_fixture('weekday.nhn.html'))
        assert (browser.get_series_list() ==
                read_fixture('weekday.nhn.parsed.yaml'))
Ejemplo n.º 5
0
def test_safe_ip_addr(get_public_ip, ip_addr, app):
    with app.test_client():
        get_public_ip.return_value = IPAddress(ip_addr)
        browser = NaverBrowser()
        browser.ensure_not_blacklisted()
Ejemplo n.º 6
0
def test_blacklisted_ip_addr(get_public_ip, ip_addr, app):
    with app.test_client():
        get_public_ip.return_value = IPAddress(ip_addr)
        browser = NaverBrowser()
        with pytest.raises(AccessDenied):
            browser.ensure_not_blacklisted()
Ejemplo n.º 7
0
def test_safe_ip_addr(get_public_ip, ip_addr, app):
    with app.test_client():
        get_public_ip.return_value = IPAddress(ip_addr)
        browser = NaverBrowser()
        browser.ensure_not_blacklisted()
Ejemplo n.º 8
0
def test_blacklisted_ip_addr(get_public_ip, ip_addr, app):
    with app.test_client():
        get_public_ip.return_value = IPAddress(ip_addr)
        browser = NaverBrowser()
        with pytest.raises(AccessDenied):
            browser.ensure_not_blacklisted()