def test_good_hashed(self, update_mock: mock.Mock): users.update_password(USR, PWD, 'new_pwd') update_mock.assert_called() new_pwd_input = update_mock.call_args[0][1]['password'] self.assertNotEqual(new_pwd_input, 'new_pwd')
def test_wrong_password(self, update_mock: mock.Mock): with self.assertRaises(exceptions.ForbiddenException): users.update_password(USR, 'wrong_pwd', 'new_pwd') update_mock.assert_not_called()
def test_bad_new_password(self, update_mock: mock.Mock): with self.assertRaises(exceptions.BadRequestException): users.update_password(USR, 'wrong_pwd', 'new_pwd') update_mock.assert_not_called()
def test_not_found(self, update_mock: mock.Mock): with self.assertRaises(exceptions.NotFoundException): users.update_password(USR, 'pwd', 'new_pwd')