def testParseMessageData5(self): testpm5 = parseMessageData( '["forward", '+ '[["R1","R2","R3"], '+ '"ev:typ", '+ 'null, '+ '"payload"]]') self.assertEqual(testpm5, ['forward', [['R1', 'R2', 'R3'], 'ev:typ', None, 'payload']])
def testParseMessageData4(self): testpm4 = parseMessageData( '["forward", '+ '[["R1","R2","R3"], '+ '"ev:typ", '+ '**, '+ '"payload"]]') assert testpm4 is None
def testParseMessageData3(self): testpm3 = parseMessageData( '["forward", '+ '[["R1","R2","R3"], '+ '"ev:typ", '+ '"ev:src", '+ '"payload"]]') self.assertEqual(testpm3, ['forward', [['R1', 'R2', 'R3'], 'ev:typ', 'ev:src', 'payload']])
def testParseMessageData2(self): testpm2 = parseMessageData( '["forward", '+ '[[], '+ '"s://auth.b/path/type/d#frag", '+ '"s://auth.b/path/source/d#frag", '+ 'null]]') self.assertEqual(testpm2, ['forward', [[], 's://auth.b/path/type/d#frag', 's://auth.b/path/source/d#frag', None]])
def testParseMessageData2(self): testpm2 = parseMessageData('["forward", ' + '[[], ' + '"s://auth.b/path/type/d#frag", ' + '"s://auth.b/path/source/d#frag", ' + 'null]]') self.assertEqual(testpm2, [ 'forward', [[], 's://auth.b/path/type/d#frag', 's://auth.b/path/source/d#frag', None] ])
def testParseMessageData1(self): testpm1 = parseMessageData( '["forward", '+ '[["R1","R2","R3"], '+ '"http://id.webbrick.co.uk/events/subscribe", '+ '"ev:type", '+ '[11, "s://auth.b/path/type/d#frag", "s://auth.b/path/source/d#frag"]]]') self.assertEqual(testpm1, [ "forward", [["R1","R2","R3"], "http://id.webbrick.co.uk/events/subscribe", "ev:type", [11, 's://auth.b/path/type/d#frag', 's://auth.b/path/source/d#frag']]])
def testParseMessageData1(self): testpm1 = parseMessageData( '["forward", ' + '[["R1","R2","R3"], ' + '"http://id.webbrick.co.uk/events/subscribe", ' + '"ev:type", ' + '[11, "s://auth.b/path/type/d#frag", "s://auth.b/path/source/d#frag"]]]' ) self.assertEqual(testpm1, [ "forward", [["R1", "R2", "R3"], "http://id.webbrick.co.uk/events/subscribe", "ev:type", [ 11, 's://auth.b/path/type/d#frag', 's://auth.b/path/source/d#frag' ]] ])
def testParseMessageData9(self): testpm9 = parseMessageData('["idle", ["foobar"]]') assert testpm9 is None
def testParseMessageData10(self): testpm10 = parseMessageData('["idle"]') assert testpm10 is None
def testParseMessageData7(self): testpm7 = parseMessageData('["closedown", ["foobar"]]') assert testpm7 is None
def testParseMessageData8(self): testpm8 = parseMessageData('["idle", []]') self.assertEqual(testpm8, ['idle', []])
def testParseMessageData5(self): testpm5 = parseMessageData('["forward", ' + '[["R1","R2","R3"], ' + '"ev:typ", ' + 'null, ' + '"payload"]]') self.assertEqual( testpm5, ['forward', [['R1', 'R2', 'R3'], 'ev:typ', None, 'payload']])
def testParseMessageData6(self): testpm6 = parseMessageData('["closedown", []]') self.assertEqual(testpm6, ['closedown', []]) self.assertEqual(testpm6, ['closedown', []])
def testParseMessageData3(self): testpm3 = parseMessageData('["forward", ' + '[["R1","R2","R3"], ' + '"ev:typ", ' + '"ev:src", ' + '"payload"]]') self.assertEqual( testpm3, ['forward', [['R1', 'R2', 'R3'], 'ev:typ', 'ev:src', 'payload']])
def testParseMessageData6(self): testpm6 = parseMessageData('["closedown", []]') self.assertEqual(testpm6, ['closedown',[]]) self.assertEqual(testpm6, ['closedown',[]])
def testParseMessageData12(self): testpm12 = parseMessageData('["foobar", []]') assert testpm12 is None
def testParseMessageData11(self): testpm11 = parseMessageData('["idle", 666]') assert testpm11 is None
def testParseMessageData4(self): testpm4 = parseMessageData('["forward", ' + '[["R1","R2","R3"], ' + '"ev:typ", ' + '**, ' + '"payload"]]') assert testpm4 is None
def testParseMessageData8(self): testpm8 = parseMessageData('["idle", []]') self.assertEqual(testpm8, ['idle',[]])