Esempio n. 1
0
 def test_setup_header_with_blank_header(self):
     test_header = {}
     return_expected = {
         'User-Agent': FuzzWord('FuzzingTool Requester Agent'),
         'Accept-Encoding': FuzzWord('gzip, deflate')
     }
     returned_data = Requester._Requester__setup_header(
         Requester, test_header)
     self.assertIsInstance(returned_data, dict)
     self.assertIsInstance(returned_data['User-Agent'], FuzzWord)
     self.assertIsInstance(returned_data['Accept-Encoding'], FuzzWord)
     self.assertDictEqual(returned_data, return_expected)
Esempio n. 2
0
 def test_setup_header_with_filled_header(self):
     test_header = {'User-Agent': 'Test User Agent', 'Content-Length': '21'}
     return_expected = {
         'User-Agent': FuzzWord('Test User Agent'),
         'Accept-Encoding': FuzzWord('gzip, deflate')
     }
     returned_data = Requester._Requester__setup_header(
         Requester, test_header)
     self.assertIsInstance(returned_data, dict)
     self.assertIsInstance(returned_data['User-Agent'], FuzzWord)
     self.assertIsInstance(returned_data['Accept-Encoding'], FuzzWord)
     self.assertEqual(('Content-Length' in returned_data.keys()), False)
     self.assertDictEqual(returned_data, return_expected)