def test_iterate_over_results(self): model1 = SendResult(id=1, points=0.1) model2 = SendResult(id=2, points=0.2) r = ResultCollection(2, [model1, model2]) self.assertEqual(model1, r.next()) self.assertEqual(model2, r.next())
def test_iterate_over_results(self): model1 = SendResult(id=1, points=0.1) model2 = SendResult(id=2, points=0.2) r = ResultCollection(2, [model1, model2]) self.assertEqual(model1, r.next()) self.assertEqual(model2, r.next())
def assertSendResultForNumberEquals(self, number, result): numbers = number if isinstance(number, list) else [number] expected_result = ResultCollection( len(numbers), [create_send_result(n) for n in numbers]) self.assertEqual(expected_result, result)
def test_send_vms_to_group(self): args = {'group': 'any'} result = self.client.vms.send_to_group(**args) expected_result = ResultCollection(1, [create_send_result('48100200300')]) self.assertParamsForwardedToRequestEquals(args) self.assertEqual(expected_result, result)
def test_list_sender_names(self): result = self.client.sender.list() expected_result = ResultCollection(2, [ create_sender_name_result('any'), create_sender_name_result('some'), ]) self.assertEqual(expected_result, result) self.assertParamsForwardedToRequestEquals({'list': True})
def test_remove_scheduled_sms(self): sms_id = '1' args = {'id': sms_id} result = self.client.sms.remove_scheduled(id=sms_id) expected_result = ResultCollection(1, [RemoveMessageResult(id='1')]) self.assertParamsForwardedToRequestEquals(args) self.assertEqual(expected_result, result)
def test_list_users(self): result = self.client.account.list_users() expected_result = ResultCollection(2, [ create_user_result(name='some'), create_user_result(name='any'), ]) self.assertEqual(expected_result, result) self.assertParamsForwardedToRequestEquals({'list': 1})
def test_remove_scheduled_mms(self): result = self.client.mms.remove_scheduled(id='1') expected_result = ResultCollection(1, [RemoveMessageResult(id='1')]) self.assertEqual(expected_result, result)