Example #1
0
 def test_send_sms_when_account_valid(self):
     account_db = StubAccountDB()
     passwd_hash = StubHash2()
     validator = ValidateAccount(account_db, passwd_hash, self.mockMobile)
     validator.check_account('kent', '1234')
     self.mockMobile.send_text.assert_called_with('kent', 'Account Not Valid')  # Use mock object to assert.
Example #2
0
 def test_validate_invalid_passwd(self):
     account_db = StubAccountDB()
     passwd_hash = StubHash2()
     validator = ValidateAccount(account_db, passwd_hash, self.mockMobile)
     self.assertFalse(validator.check_account('kent', '1234'))