def test_init(self): l = cli.listing([1, 'two'], separator=':') self.assertEqual([1, 'two'], list(l)) self.assertEqual(':', l.separator) l = cli.listing([]) self.assertEqual(',', l.separator)
def test_str(self): l = cli.listing([1, 'two']) result = str(l) self.assertEqual('1,two', result) l = cli.listing((x for x in [1, 'two']), separator=':') result = str(l) self.assertEqual('1:two', result)
def test_to_python(self): l = cli.listing([1, 'two']) result = l.to_python() self.assertEqual([1, 'two'], result) l = cli.listing(x for x in [1, 'two']) result = l.to_python() self.assertEqual([1, 'two'], result)