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.
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'))