Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanLCox1 committed May 31, 2024
1 parent 4ac794e commit fb17c04
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions test/custom_header_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ def test_custom_headers_set(self):
sender = smarty.RequestsSender
header = {'Test-User-Agent': 'Test-Agent', 'Test-Content-Type': 'Test-Type'}
sender = smarty.CustomHeaderSender(header, sender)
smartyrequest = smarty.Request()
smartyrequest.url_prefix = "http://localhost"
smartyrequest.payload = "This is the test content."
smarty_request = smarty.Request()
smarty_request.url_prefix = "http://localhost"
smarty_request.payload = "This is the test content."

request = sender.build_request(smartyrequest)
request = sender.build_request(smarty_request)

self.assertEqual('Test-Agent', request.headers['Test-User-Agent'])
self.assertEqual('Test-Type', request.headers['Test-Content-Type'])
Expand All @@ -29,13 +29,11 @@ def test_custom_headers_used(self):
sender = smarty.RequestsSender()
header = {'User-Agent': 'Test-Agent', 'Content-Type': 'Test-Type'}
sender = smarty.CustomHeaderSender(header, sender)
smartyrequest = smarty.Request()
smartyrequest.url_prefix = "http://localhost"
smartyrequest.payload = "This is the test content."
smarty_request = smarty.Request()
smarty_request.url_prefix = "http://localhost"
smarty_request.payload = "This is the test content."

request = sender.build_request(smartyrequest)

request = smarty.requests_sender.build_request(request)
request = sender.build_request(smarty_request)

self.assertEqual('Test-Agent', request.headers['User-Agent'])
self.assertEqual('Test-Type', request.headers['Content-Type'])

0 comments on commit fb17c04

Please sign in to comment.