From 420d83bb87ece3b3c93169ad698b6dffd457e388 Mon Sep 17 00:00:00 2001 From: Filipe Pina Date: Sun, 27 Jan 2019 13:27:08 +0000 Subject: [PATCH] pykeepass fixed #4 --- tests.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests.py b/tests.py index fa60ac9..d048d74 100644 --- a/tests.py +++ b/tests.py @@ -137,6 +137,24 @@ def test_run_keyfile(self, ch_mock, gp_mock): mock.call('blabla') ]) + @mock.patch('getpass.getpass') + @mock.patch('kdbxpasswordpwned.check_hash') + def test_issue_4(self, ch_mock, gp_mock): + ''' + https://github.com/fopina/kdbxpasswordpwned/issues/4 + argon format support added by moving + from libkeepass to pykeepass + ''' + gp_mock.return_value = '123456' + ch_mock.return_value = 0 + with _capture_output() as fout: + kdbxpasswordpwned.main([ + _asset('issue_4.kdbx'), + ]) + self.assertEqual(fout[0].getvalue(), '') + ch_mock.assert_not_called() + + def _asset(name): return os.path.join(