Exemplo n.º 1
0
 def test_filled(self):
     formdata = TornadoInputWrapper(self.filled_mdict)
     self.assertTrue(formdata)
     self.assertEqual(len(formdata), 2)
     self.assertEqual(sorted(list(formdata)), sorted(['a', 'b']))
     self.assertTrue('b' in formdata)
     self.assertTrue('fake' not in formdata)
     self.assertEqual(formdata.getlist('a'), ['Apple', 'Cherry'])
     self.assertEqual(formdata.getlist('b'), ['Banana'])
     self.assertEqual(formdata.getlist('fake'), [])
Exemplo n.º 2
0
 def test_filled(self):
     formdata = TornadoInputWrapper(self.filled_mdict)
     self.assertTrue(formdata)
     self.assertEqual(len(formdata), 2)
     self.assertEqual(sorted(list(formdata)), sorted(['a', 'b']))
     self.assertTrue('b' in formdata)
     self.assertTrue('fake' not in formdata)
     self.assertEqual(formdata.getlist('a'), ['Apple', 'Cherry'])
     self.assertEqual(formdata.getlist('b'), ['Banana'])
     self.assertEqual(formdata.getlist('fake'), [])
Exemplo n.º 3
0
 def test_empty(self):
     formdata = TornadoInputWrapper(self.empty_mdict)
     self.assertFalse(formdata)
     self.assertEqual(len(formdata), 0)
     self.assertEqual(list(formdata), [])
     self.assertEqual(formdata.getlist('fake'), [])
Exemplo n.º 4
0
 def setUp(self):
     self.test_values = HTTPRequest(
         'GET', 'http://localhost?a=Apple&b=Banana&a=Cherry')
     self.empty_mdict = TornadoInputWrapper({})
     self.filled_mdict = TornadoInputWrapper(self.test_values.arguments)
Exemplo n.º 5
0
 def test_empty(self):
     formdata = TornadoInputWrapper(self.empty_mdict)
     self.assertFalse(formdata)
     self.assertEqual(len(formdata), 0)
     self.assertEqual(list(formdata), [])
     self.assertEqual(formdata.getlist('fake'), [])