Skip to content

Commit 8e31451

Browse files
committed
test with for loop in spec
1 parent 79e1735 commit 8e31451

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

specs/client/request_spec.py

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -86,25 +86,34 @@
8686
expect(self.request.http_request.data).to(
8787
equal(b'{\"foo\": \"bar\"}'))
8888

89-
with it('should return X-HTTP-Method-Override as GET in HTTP header for some endpoints'):
90-
self.request = Request({
91-
'host': self.host,
92-
'verb': 'POST',
93-
'path': self.path,
94-
'params': self.params,
95-
'bearer_token': self.bearer_token,
96-
'client_version': self.client_version,
97-
'language_version': self.lang_version,
98-
'app_id': self.app_id,
99-
'app_version': self.app_version,
100-
'port': self.port,
101-
'ssl': self.ssl
102-
})
89+
with it('should return X-HTTP-Method-Override in header'):
90+
self.path =[
91+
'/v2/shopping/flight-offers',
92+
'/v1/shopping/seatmaps',
93+
'/v1/shopping/availability/flight-availabilities',
94+
'/v2/shopping/flight-offers/prediction',
95+
'/v1/shopping/flight-offers/pricing?',
96+
'/v1/shopping/flight-offers/upselling'
97+
]
98+
for i in self.path:
99+
self.request = Request({
100+
'host': self.host,
101+
'verb': 'POST',
102+
'path': self.path,
103+
'params': self.params,
104+
'bearer_token': self.bearer_token,
105+
'client_version': self.client_version,
106+
'language_version': self.lang_version,
107+
'app_id': self.app_id,
108+
'app_version': self.app_version,
109+
'port': self.port,
110+
'ssl': self.ssl
111+
})
103112

104-
expect(self.request.http_request).to(be_a(HTTPRequest))
105-
expect(self.request.http_request.get_header('X-HTTP-Method-Override')).to(
106-
equal('GET')
107-
)
113+
expect(self.request.http_request).to(be_a(HTTPRequest))
114+
expect(self.request.http_request.get_header('X-HTTP-Method-Override')).to(
115+
equal('GET')
116+
)
108117

109118
with it('should handle a custom scheme and port'):
110119
self.request = Request({

0 commit comments

Comments
 (0)