Add test for utils.get_clipboard with empty clipboard
This commit is contained in:
parent
7ba01e6764
commit
7d7f5350c5
@ -825,6 +825,12 @@ class TestGetSetClipboard:
|
|||||||
def test_get(self):
|
def test_get(self):
|
||||||
assert utils.get_clipboard() == 'mocked clipboard text'
|
assert utils.get_clipboard() == 'mocked clipboard text'
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('selection', [True, False])
|
||||||
|
def test_get_empty(self, clipboard_mock, selection):
|
||||||
|
clipboard_mock.text.return_value = ''
|
||||||
|
with pytest.raises(utils.ClipboardEmptyError):
|
||||||
|
utils.get_clipboard(selection=selection)
|
||||||
|
|
||||||
def test_get_unsupported_selection(self, clipboard_mock):
|
def test_get_unsupported_selection(self, clipboard_mock):
|
||||||
clipboard_mock.supportsSelection.return_value = False
|
clipboard_mock.supportsSelection.return_value = False
|
||||||
with pytest.raises(utils.SelectionUnsupportedError):
|
with pytest.raises(utils.SelectionUnsupportedError):
|
||||||
|
Loading…
Reference in New Issue
Block a user