tests/test-wireproto-framing.py
changeset 45942 89a2afe31e82
parent 43076 2372284d9457
child 48875 6000f5b25c9b
equal deleted inserted replaced
45941:346af7687c6f 45942:89a2afe31e82
   190 
   190 
   191     def testtextoutput2simpleatoms(self):
   191     def testtextoutput2simpleatoms(self):
   192         stream = framing.stream(1)
   192         stream = framing.stream(1)
   193         val = list(
   193         val = list(
   194             framing.createtextoutputframe(
   194             framing.createtextoutputframe(
   195                 stream, 1, [(b'foo', [], []), (b'bar', [], []),]
   195                 stream,
       
   196                 1,
       
   197                 [
       
   198                     (b'foo', [], []),
       
   199                     (b'bar', [], []),
       
   200                 ],
   196             )
   201             )
   197         )
   202         )
   198 
   203 
   199         self.assertEqual(
   204         self.assertEqual(
   200             val,
   205             val,
   208 
   213 
   209     def testtextoutput1arg(self):
   214     def testtextoutput1arg(self):
   210         stream = framing.stream(1)
   215         stream = framing.stream(1)
   211         val = list(
   216         val = list(
   212             framing.createtextoutputframe(
   217             framing.createtextoutputframe(
   213                 stream, 1, [(b'foo %s', [b'val1'], []),]
   218                 stream,
       
   219                 1,
       
   220                 [
       
   221                     (b'foo %s', [b'val1'], []),
       
   222                 ],
   214             )
   223             )
   215         )
   224         )
   216 
   225 
   217         self.assertEqual(
   226         self.assertEqual(
   218             val,
   227             val,
   226 
   235 
   227     def testtextoutput2arg(self):
   236     def testtextoutput2arg(self):
   228         stream = framing.stream(1)
   237         stream = framing.stream(1)
   229         val = list(
   238         val = list(
   230             framing.createtextoutputframe(
   239             framing.createtextoutputframe(
   231                 stream, 1, [(b'foo %s %s', [b'val', b'value'], []),]
   240                 stream,
       
   241                 1,
       
   242                 [
       
   243                     (b'foo %s %s', [b'val', b'value'], []),
       
   244                 ],
   232             )
   245             )
   233         )
   246         )
   234 
   247 
   235         self.assertEqual(
   248         self.assertEqual(
   236             val,
   249             val,
   244 
   257 
   245     def testtextoutput1label(self):
   258     def testtextoutput1label(self):
   246         stream = framing.stream(1)
   259         stream = framing.stream(1)
   247         val = list(
   260         val = list(
   248             framing.createtextoutputframe(
   261             framing.createtextoutputframe(
   249                 stream, 1, [(b'foo', [], [b'label']),]
   262                 stream,
       
   263                 1,
       
   264                 [
       
   265                     (b'foo', [], [b'label']),
       
   266                 ],
   250             )
   267             )
   251         )
   268         )
   252 
   269 
   253         self.assertEqual(
   270         self.assertEqual(
   254             val,
   271             val,
   262 
   279 
   263     def testargandlabel(self):
   280     def testargandlabel(self):
   264         stream = framing.stream(1)
   281         stream = framing.stream(1)
   265         val = list(
   282         val = list(
   266             framing.createtextoutputframe(
   283             framing.createtextoutputframe(
   267                 stream, 1, [(b'foo %s', [b'arg'], [b'label']),]
   284                 stream,
       
   285                 1,
       
   286                 [
       
   287                     (b'foo %s', [b'arg'], [b'label']),
       
   288                 ],
   268             )
   289             )
   269         )
   290         )
   270 
   291 
   271         self.assertEqual(
   292         self.assertEqual(
   272             val,
   293             val,