Exemple #1
0
 def test_try_getpass_eof(self):
     getpass = self.patch(auth, "getpass")
     getpass.side_effect = EOFError
     self.assertIsNone(auth.try_getpass(sentinel.prompt))
     getpass.assert_called_once_with(sentinel.prompt)
Exemple #2
0
 def test_try_getpass(self):
     getpass = self.patch(auth, "getpass")
     getpass.return_value = sentinel.credentials
     self.assertIs(sentinel.credentials, auth.try_getpass(sentinel.prompt))
     getpass.assert_called_once_with(sentinel.prompt)
Exemple #3
0
 def test_try_getpass_eof(self):
     getpass = self.patch(auth, "getpass")
     getpass.side_effect = EOFError
     self.assertIsNone(auth.try_getpass(sentinel.prompt))
     self.assertThat(getpass, MockCalledOnceWith(sentinel.prompt))
Exemple #4
0
 def test_try_getpass(self):
     getpass = self.patch(auth, "getpass")
     getpass.return_value = sentinel.credentials
     self.assertIs(sentinel.credentials, auth.try_getpass(sentinel.prompt))
     self.assertThat(getpass, MockCalledOnceWith(sentinel.prompt))
Exemple #5
0
 def test_try_getpass_eof(self):
     getpass = self.patch(auth, "getpass")
     getpass.side_effect = EOFError
     self.assertIsNone(auth.try_getpass(sentinel.prompt))
     getpass.assert_called_once_with(sentinel.prompt)
Exemple #6
0
 def test_try_getpass(self):
     getpass = self.patch(auth, "getpass")
     getpass.return_value = sentinel.credentials
     self.assertIs(sentinel.credentials, auth.try_getpass(sentinel.prompt))
     getpass.assert_called_once_with(sentinel.prompt)