def test_count(self): total = 10 result = response((0, total)) self.assertEqual(result['total'], total) self.assertTrue(result['success'])
def test_dict(self): result = response({1: 1}) self.assertEqual(result['total'], 1) self.assertTrue(result['success'])
def test_empty_iterable(self): result = response([]) self.assertEqual(result['total'], 0) self.assertTrue(result['success'])
def test_simple(self): result = response(1) self.assertEqual(result['total'], 1) self.assertTrue(result['success'])
def test_none(self): result = response(None) self.assertEqual(result['total'], 0) self.assertTrue(result['success'])