Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | import mozhttpd |
michael@0 | 2 | import unittest |
michael@0 | 3 | |
michael@0 | 4 | class BaseUrlTest(unittest.TestCase): |
michael@0 | 5 | |
michael@0 | 6 | def test_base_url(self): |
michael@0 | 7 | httpd = mozhttpd.MozHttpd(port=0) |
michael@0 | 8 | self.assertEqual(httpd.get_url(), None) |
michael@0 | 9 | httpd.start(block=False) |
michael@0 | 10 | self.assertEqual("http://127.0.0.1:%s/" % httpd.httpd.server_port, |
michael@0 | 11 | httpd.get_url()) |
michael@0 | 12 | self.assertEqual("http://127.0.0.1:%s/cheezburgers.html" % \ |
michael@0 | 13 | httpd.httpd.server_port, |
michael@0 | 14 | httpd.get_url(path="/cheezburgers.html")) |
michael@0 | 15 | httpd.stop() |
michael@0 | 16 | |
michael@0 | 17 | if __name__ == '__main__': |
michael@0 | 18 | unittest.main() |