From 78b4b6af18a40db3162aad56eb726a26c5a74e8c Mon Sep 17 00:00:00 2001 From: ionite34 Date: Thu, 24 Nov 2022 10:32:32 +0800 Subject: Refactor output files in `output` dir --- tests/test_integration.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'tests/test_integration.py') diff --git a/tests/test_integration.py b/tests/test_integration.py index 086abab..ba0d9b5 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -62,11 +62,15 @@ class IntegrationTests(unittest.TestCase): "path": "main.py", "content": b64encode_code( """ + from pathlib import Path from mod import lib print(lib.var) - with open('output.txt', 'w') as f: - f.write('file write test') + with open('output/test.txt', 'w') as f: + f.write('test 1') + + Path('output/dir').mkdir() + Path('output/dir/test2.txt').write_text('test 2') """ ), }, @@ -80,10 +84,15 @@ class IntegrationTests(unittest.TestCase): "returncode": 0, "files": [ { - "path": "output.txt", - "size": len("file write test"), - "content": b64encode_code("file write test"), - } + "path": "dir/test2.txt", + "size": len("test 2"), + "content": b64encode_code("test 2"), + }, + { + "path": "test.txt", + "size": len("test 1"), + "content": b64encode_code("test 1"), + }, ], } -- cgit v1.2.3