예제 #1
0
    def test_create_qqtag(self):
        q = QqTag({'a': 'b'})
        self.assertEqual(q.name, 'a')
        self.assertEqual(q.value, 'b')

        q = QqTag('a', [
            QqTag('b', 'hello'),
            QqTag('c', 'world'),
            QqTag('b', 'this'),
            QqTag('--+-', [QqTag('b', 'way'), "this"])
        ])

        self.assertEqual(q.name, 'a')
        #self.assertEqual(q._children, IndexedList([QqTag('b', ['hello']), QqTag('c', ['world']), QqTag('b', ['this']),
        #                                           QqTag('--+-', [QqTag('b', ['way']), 'this'])]))
        #self.assertEqual(eval(repr(q)), q)
        self.assertEqual(q.as_list(), [
            'a', ['b', 'hello'], ['c', 'world'], ['b', 'this'],
            ['--+-', ['b', 'way'], 'this']
        ])
예제 #2
0
파일: test_ml.py 프로젝트: ischurov/qqmbr
    def test_create_qqtag(self):
        q = QqTag({'a': 'b'})
        self.assertEqual(q.name, 'a')
        self.assertEqual(q.value, 'b')

        q = QqTag('a', [
            QqTag('b', 'hello'),
            QqTag('c', 'world'),
            QqTag('b', 'this'),
            QqTag('--+-', [
                QqTag('b', 'way'),
                "this"
            ])])

        self.assertEqual(q.name, 'a')
        #self.assertEqual(q._children, IndexedList([QqTag('b', ['hello']), QqTag('c', ['world']), QqTag('b', ['this']),
        #                                           QqTag('--+-', [QqTag('b', ['way']), 'this'])]))
        #self.assertEqual(eval(repr(q)), q)
        self.assertEqual(q.as_list(),
                         ['a', ['b', 'hello'], ['c', 'world'], ['b', 'this'], ['--+-', ['b', 'way'], 'this']])