mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Merge pull request #372 from untitaker/test-open-graphical-browser
Add tests for open_graphical_browser
This commit is contained in:
commit
55914bd575
1 changed files with 14 additions and 0 deletions
|
|
@ -79,3 +79,17 @@ def test_request_ssl_fingerprints(httpsserver, fingerprint):
|
|||
utils.http.request('GET', httpsserver.url, verify=False,
|
||||
verify_fingerprint=''.join(reversed(fingerprint)))
|
||||
assert 'Fingerprints did not match' in str(excinfo.value)
|
||||
|
||||
|
||||
def test_open_graphical_browser(monkeypatch):
|
||||
import webbrowser
|
||||
# Just assert that this internal attribute still exists,is some sort of
|
||||
# collection and non-empty
|
||||
assert len(webbrowser._tryorder)
|
||||
|
||||
monkeypatch.setattr('webbrowser._tryorder', [])
|
||||
|
||||
with pytest.raises(RuntimeError) as excinfo:
|
||||
utils.open_graphical_browser('http://example.com')
|
||||
|
||||
assert 'No graphical browser found' in str(excinfo.value)
|
||||
|
|
|
|||
Loading…
Reference in a new issue