示例#1
0
文件: test_pubsub.py 项目: safl/levis
    def test_parse(self):

        kd = pubsub.key_to_attr(self.key)

        self.assertEqual(len(kd), 4)
        self.assertTrue(kd.has_key('Type'))
        self.assertTrue(kd.has_key('Representation'))
        self.assertTrue(kd.has_key('Compression'))
        self.assertTrue(kd.has_key('Result'))

        self.assertEqual(kd['Type'], 'win_events')
        self.assertEqual(kd['Representation'], 'string')
        self.assertEqual(kd['Compression'], 'False')
        self.assertEqual(kd['Result'], 'False')
示例#2
0
文件: test_pubsub.py 项目: safl/levis
    def test_parse_noright(self):

        kd = pubsub.key_to_attr("Type=win_events.Representation=")
        self.assertEqual(len(kd), 1)
示例#3
0
文件: test_pubsub.py 项目: safl/levis
    def test_parse_noleft(self):

        kd = pubsub.key_to_attr("Type=win_events.=string")
        self.assertEqual(len(kd), 1)
示例#4
0
文件: test_pubsub.py 项目: safl/levis
    def test_parse_dotnoleft(self):

        kd = pubsub.key_to_attr(".Type=win_events.Representation=string")

        self.assertEqual(len(kd), 2)
示例#5
0
文件: test_pubsub.py 项目: safl/levis
    def test_parse_empty(self):

        kd = pubsub.key_to_attr("")

        self.assertEqual(len(kd), 0)