Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override test_empty_username from keyring 25.3.0 for file backend #55

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def Put(
delattr(self, '_put_err')
else:
put_err = self._put_err
if type(put_err) == tuple:
if type(put_err) is tuple:
raise put_err[0](put_err[1])
else:
raise put_err()
Expand All @@ -161,7 +161,7 @@ def Export(self, entry_or_id_or_url, file_path, gid=None, extra_params=None):

def request(self, data, uri):
if hasattr(self, '_request_err'):
if type(self._request_err) == tuple:
if type(self._request_err) is tuple:
raise self._request_err[0](self._request_err[1])
else:
raise self._request_err()
Expand Down
4 changes: 4 additions & 0 deletions tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ def test_version(self):
self.save_config(config)
assert self.keyring._check_version(config) is False

def test_empty_username(self):
with pytest.raises(ValueError):
self.set_password('service1', '', 'password1')


@pytest.fixture(scope="class")
def monkeyclass(request):
Expand Down
Loading