https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 9868ad502b989cff5d9a64ac8c0fee9c98f3a5b8 authored by Andy Paicu on 23 March 2018, 15:46:19 UTC
Remove browsing context name on cross origin navigation
Tip revision: 9868ad5
test_serve.py
from . import serve

def test_make_hosts_file():
    hosts = serve.make_hosts_file({
        "domains": {"www": "www.foo.bar.test", "www1": "www1.foo.bar.test"},
        "not_domains": {"aaa": "aaa.foo.bar.test", "bbb": "bbb.foo.bar.test"}
    }, "127.1.1.1")
    lines = hosts.split("\n")
    assert "127.1.1.1\twww.foo.bar.test" in lines
    assert "127.1.1.1\twww1.foo.bar.test" in lines
    assert "0.0.0.0\taaa.foo.bar.test" in lines
    assert "0.0.0.0\tbbb.foo.bar.test" in lines
back to top