(context: Context)
| 101 | |
| 102 | @when("I save that stream to a file") |
| 103 | def when_save_stream_to_a_file(context: Context): |
| 104 | if os.path.isfile(saved_pptx_path): |
| 105 | os.remove(saved_pptx_path) |
| 106 | context.stream.seek(0) |
| 107 | with open(saved_pptx_path, "wb") as f: |
| 108 | f.write(context.stream.read()) |
| 109 | |
| 110 | |
| 111 | @when("I save the presentation") |