示例#1
0
 def test_open_webbrowser_bad_open(self, mock_method):
     full_url = 'http://www.openbazaar.org'
     self.assertFalse(util.open_default_webbrowser(full_url))
示例#2
0
 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))
示例#3
0
 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)
示例#4
0
 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)
示例#5
0
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))