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