Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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)