'Verify that various kinds of data make it through the encode/parse
round-trip unharmed.'

def test_ParsingRoundTrip(self):

    (c, s, p) = connectedServerAndClient(ClientClass=LiteralAmp, ServerClass=LiteralAmp)
    SIMPLE = ('simple', 'test')
    CE = ('ceq', ':    ')
    CR = ('crtest', 'test\r')
    LF = ('lftest', 'hello\n')
    NEWLINE = ('newline', 'test\r\none\r\ntwo')
    NEWLINE2 = ('newline2', 'test\r\none\r\n    two')
    BODYTEST = ('body', 'blah\r\n\r\ntesttest')
    testData = [[SIMPLE], [SIMPLE, BODYTEST], [SIMPLE, CE], [SIMPLE, CR], [SIMPLE, CE, CR, LF], [CE, CR, LF], [SIMPLE, NEWLINE, CE, NEWLINE2], [BODYTEST, SIMPLE, NEWLINE]]
    for test in testData:
        jb = amp.Box()
        jb.update(dict(test))
        jb._sendTo(c)
        p.flush()
        self.assertEqual(s.boxes[(-1)], jb)
