@@ -93,15 +93,15 @@ def test_attachment_zip_file(self):
9393 responses .POST ,
9494 "{}/intake/organizations/{}/workspaces/{}/builds/{}/test_sessions/{}/attachment" .format (
9595 get_base_url (), self .organization , self .workspace , self .build_name , self .session_id ),
96- match = [responses .matchers .header_matcher ({"Content-Disposition" : 'attachment;filename="nested/ debug.log"' })],
96+ match = [responses .matchers .header_matcher ({"Content-Disposition" : 'attachment;filename="debug.log"' })],
9797 status = 200 )
9898
9999 expect = """
100- | File | Status |
101- |------------------ |----------------------------------|
102- | app.log | ⚠ Failed to record |
103- | nested/ debug.log | ✓ Recorded successfully |
104- | binary.dat | ⚠ Skipped: not a valid text file |
100+ | File | Status |
101+ |------------|----------------------------------|
102+ | app.log | ⚠ Failed to record |
103+ | debug.log | ✓ Recorded successfully |
104+ | binary.dat | ⚠ Skipped: not a valid text file |
105105"""
106106
107107 result = self .cli ("record" , "attachment" , "--session" , self .session , zip_path )
@@ -150,15 +150,15 @@ def test_attachment_with_include_filter(self):
150150 responses .POST ,
151151 "{}/intake/organizations/{}/workspaces/{}/builds/{}/test_sessions/{}/attachment" .format (
152152 get_base_url (), self .organization , self .workspace , self .build_name , self .session_id ),
153- match = [responses .matchers .header_matcher ({"Content-Disposition" : 'attachment;filename="nested/ debug.log"' })],
153+ match = [responses .matchers .header_matcher ({"Content-Disposition" : 'attachment;filename="debug.log"' })],
154154 status = 200 )
155155
156156 result = self .cli ("record" , "attachment" , "--session" , self .session , "--include" , "*.log" , zip_path )
157157
158- expect = """| File | Status |
159- |------------------ |-------------------------|
160- | app.log | ✓ Recorded successfully |
161- | nested/ debug.log | ✓ Recorded successfully |
158+ expect = """| File | Status |
159+ |-----------|-------------------------|
160+ | app.log | ✓ Recorded successfully |
161+ | debug.log | ✓ Recorded successfully |
162162"""
163163 self .assertEqual (expect , result .output )
164164
@@ -196,15 +196,15 @@ def test_attachment_with_identical_file_names(self):
196196 responses .POST ,
197197 "{}/intake/organizations/{}/workspaces/{}/builds/{}/test_sessions/{}/attachment" .format (
198198 get_base_url (), self .organization , self .workspace , self .build_name , self .session_id ),
199- match = [responses .matchers .header_matcher ({"Content-Disposition" : 'attachment;filename="app.1 .log"' })],
199+ match = [responses .matchers .header_matcher ({"Content-Disposition" : 'attachment;filename="nested- app.log"' })],
200200 status = 200 )
201201
202202 result = self .cli ("record" , "attachment" , "--session" , self .session , zip_path )
203203
204204 expect = """| File | Status |
205205|----------------|-------------------------|
206206| app.log | ✓ Recorded successfully |
207- | nested/ app.log | ✓ Recorded successfully |
207+ | nested- app.log | ✓ Recorded successfully |
208208"""
209209 self .assertEqual (expect , result .output )
210210
@@ -228,7 +228,7 @@ def test_attachment_with_whitespace_in_filename(self):
228228 "{}/intake/organizations/{}/workspaces/{}/builds/{}/test_sessions/{}/attachment" .format (
229229 get_base_url (), self .organization , self .workspace , self .build_name , self .session_id ),
230230 match = [responses .matchers .header_matcher (
231- {"Content-Disposition" : 'attachment;filename="{}"' .format (file_path . replace ( ' ' , '-' ) )}
231+ {"Content-Disposition" : 'attachment;filename="{}"' .format ("app-log-file.txt" )}
232232 )],
233233 status = 200 )
234234
0 commit comments