(self)
| 30 | cmd.execute(params, verbose=True) |
| 31 | |
| 32 | def test_login(self): |
| 33 | params = get_user_params() |
| 34 | cmd = utils.LoginCommand() |
| 35 | with mock.patch('builtins.input') as mock_input, \ |
| 36 | mock.patch('getpass.getpass') as mock_getpass, \ |
| 37 | mock.patch('keepercommander.api.login') as mock_login: |
| 38 | mock_input.return_value = 'user3@keepersecurity.com' |
| 39 | mock_getpass.return_value = '123456' |
| 40 | cmd.execute(params) |
| 41 | mock_login.assert_called() |
| 42 | |
| 43 | mock_login.reset_mock() |
| 44 | mock_input.return_value = KeyboardInterrupt() |
| 45 | mock_getpass.return_value = '123456' |
| 46 | cmd.execute(params, email='user3@keepersecurity.com') |
| 47 | mock_login.assert_called() |
| 48 | |
| 49 | mock_login.reset_mock() |
| 50 | mock_input.return_value = KeyboardInterrupt() |
| 51 | mock_getpass.return_value = KeyboardInterrupt() |
| 52 | cmd.execute(params, email='user3@keepersecurity.com', password='123456') |
| 53 | mock_login.assert_called() |
| 54 | |
| 55 | mock_login.reset_mock() |
| 56 | mock_input.return_value = '' |
| 57 | mock_getpass.return_value = '' |
| 58 | cmd.execute(params) |
| 59 | mock_login.assert_not_called() |
| 60 | |
| 61 | def test_logout(self): |
| 62 | params = get_synced_params() |
nothing calls this directly
no test coverage detected