def test_to_list(self): self.assertEquals(util.to_list(Iterable([1, 2, 3]), self.encoder), [1, 2, 3]) self.assertEquals(util.to_list(['a', 'b'], self.encoder), ['a', 'b']) self.assertEquals(util.to_list('a', self.encoder), ['a']) obj = object() self.assertRaises(TypeError, util.to_list, obj, self.encoder)
def test_to_list(self): self.assertEqual(util.to_list(Iterable([1, 2, 3]), self.encoder), [1, 2, 3]) self.assertEqual(util.to_list(['a', 'b'], self.encoder), ['a', 'b']) self.assertEqual(util.to_list('a', self.encoder), ['a']) obj = object() self.assertRaises(TypeError, util.to_list, obj, self.encoder)