Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
['example.com', 'http://example.com', 'linux'],
['http://example.com', 'http://example.com', 'win32'],
]
)
def test_browse(url, opened_url, platform):
"""test func."""
with mock.patch('buku.webbrowser') as m_webbrowser, \
mock.patch('buku.sys') as m_sys, \
mock.patch('buku.os'):
m_sys.platform = platform
get_func_retval = mock.Mock()
m_webbrowser.get.return_value = get_func_retval
import buku
buku.browse.suppress_browser_output = True
buku.browse.override_text_browser = False
buku.browse(url)
if platform == 'win32':
m_webbrowser.open.assert_called_once_with(opened_url, new=2)
else:
get_func_retval.open.assert_called_once_with(opened_url, new=2)
[
['http://example.com', 'http://example.com', 'linux'],
['example.com', 'http://example.com', 'linux'],
['http://example.com', 'http://example.com', 'win32'],
]
)
def test_browse(url, opened_url, platform):
"""test func."""
with mock.patch('buku.webbrowser') as m_webbrowser, \
mock.patch('buku.sys') as m_sys, \
mock.patch('buku.os'):
m_sys.platform = platform
get_func_retval = mock.Mock()
m_webbrowser.get.return_value = get_func_retval
import buku
buku.browse.suppress_browser_output = True
buku.browse.override_text_browser = False
buku.browse(url)
if platform == 'win32':
m_webbrowser.open.assert_called_once_with(opened_url, new=2)
else:
get_func_retval.open.assert_called_once_with(opened_url, new=2)
['http://example.com', 'http://example.com', 'linux'],
['example.com', 'http://example.com', 'linux'],
['http://example.com', 'http://example.com', 'win32'],
]
)
def test_browse(url, opened_url, platform):
"""test func."""
with mock.patch('buku.webbrowser') as m_webbrowser, \
mock.patch('buku.sys') as m_sys, \
mock.patch('buku.os'):
m_sys.platform = platform
get_func_retval = mock.Mock()
m_webbrowser.get.return_value = get_func_retval
import buku
buku.browse.suppress_browser_output = True
buku.browse.override_text_browser = False
buku.browse(url)
if platform == 'win32':
m_webbrowser.open.assert_called_once_with(opened_url, new=2)
else:
get_func_retval.open.assert_called_once_with(opened_url, new=2)