Exemplo n.º 1
0
 def test_parseKeyVal(self):
     lines = ["x=&2", "y& = 2", " z = 2 ", " s=3=&'5", " w=", "4&"]
     expectedRes = [{'x': '&2', 'y&': '2', 'z': '2', 's': "3=&'5", 'w': ''},
                    {'x=': '2', 'y': '= 2', 's=3=': "'5", '4': ''}]
     sign = ["=", "&"]
     for res, s in zip(expectedRes, sign):
         self.assertEqual(res, caps._parseKeyVal(lines, s))
Exemplo n.º 2
0
 def test_parseKeyVal(self):
     lines = ["x=&2", "y& = 2", " z = 2 ", " s=3=&'5", " w=", "4&"]
     expectedRes = [{'x': '&2', 'y&': '2', 'z': '2', 's': "3=&'5", 'w': ''},
                    {'x=': '2', 'y': '= 2', 's=3=': "'5", '4': ''}]
     sign = ["=", "&"]
     for res, s in zip(expectedRes, sign):
         self.assertEqual(res, caps._parseKeyVal(lines, s))
Exemplo n.º 3
0
 def test_parseKeyVal(self):
     lines = ["x=&2", "y& = 2", " z = 2 ", " s=3=&'5", " w=", "4&",
              u"v=1", u"temperature=”1°C”"]
     expectedRes = [{'x': '&2', 'y&': '2', 'z': '2', 's': "3=&'5", 'w': '',
                     u'v': u'1', u'temperature': u'”1°C”'},
                    {'x=': '2', 'y': '= 2', 's=3=': "'5", '4': ''}]
     sign = ["=", "&"]
     for res, s in zip(expectedRes, sign):
         self.assertEqual(res, caps._parseKeyVal(lines, s))