def test_append(self):
     orig_agent = 'bar'
     headers = {'user-agent': orig_agent}
     user_agent = 'baz'
     result = transport._apply_user_agent(headers, user_agent)
     self.assertIs(result, headers)
     final_agent = user_agent + ' ' + orig_agent
     self.assertEqual(result, {'user-agent': final_agent})
示例#2
0
 def test_append(self):
     orig_agent = 'bar'
     headers = {'user-agent': orig_agent}
     user_agent = 'baz'
     result = transport._apply_user_agent(headers, user_agent)
     self.assertIs(result, headers)
     final_agent = user_agent + ' ' + orig_agent
     self.assertEqual(result, {'user-agent': final_agent})
 def test_new_agent(self):
     headers = {}
     user_agent = 'foo'
     result = transport._apply_user_agent(headers, user_agent)
     self.assertIs(result, headers)
     self.assertEqual(result, {'user-agent': user_agent})
 def test_null(self):
     headers = object()
     result = transport._apply_user_agent(headers, None)
     self.assertIs(result, headers)
示例#5
0
 def test_new_agent(self):
     headers = {}
     user_agent = 'foo'
     result = transport._apply_user_agent(headers, user_agent)
     self.assertIs(result, headers)
     self.assertEqual(result, {'user-agent': user_agent})
示例#6
0
 def test_null(self):
     headers = object()
     result = transport._apply_user_agent(headers, None)
     self.assertIs(result, headers)