def test_open_webbrowser_bad_open(self, mock_method): full_url = 'http://www.openbazaar.org' self.assertFalse(util.open_default_webbrowser(full_url))
def test_open_webbrowser_protocol(self, webbrowser_mock): url = 'www.openbazaar.org' protocol = 'ftp' self.assertTrue(util.open_default_webbrowser(url, protocol=protocol)) webbrowser_mock.assert_called_once_with('%s://%s' % (protocol, url))
def test_open_webbrowser_bare_url(self, webbrowser_mock): url = 'www.openbazaar.org' self.assertTrue(util.open_default_webbrowser(url)) webbrowser_mock.assert_called_once_with('http://%s' % url)
def test_open_webbrowser_full_url(self, webbrowser_mock): full_url = 'http://www.openbazaar.org' self.assertTrue(util.open_default_webbrowser(full_url)) webbrowser_mock.assert_called_once_with(full_url)
def attempt_browser_open(ob_ctx): if not ob_ctx.disable_open_browser: open_default_webbrowser('http://%s:%s' % (ob_ctx.http_ip, ob_ctx.http_port))
def attempt_browser_open(ob_ctx): if not ob_ctx.disable_open_browser: open_default_webbrowser( 'http://%s:%s' % (ob_ctx.http_ip, ob_ctx.http_port))