File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed
Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ def test_list_objects_delimiter(app):
109109 assert root .tag == "ListBucketResult"
110110 assert root .find ('Name' ).text == bucket_name
111111 assert root .find ('Delimiter' ).text == '/'
112- assert len (root .findall ('CommonPrefixes' )) = = 1
112+ assert len (root .findall ('CommonPrefixes' )) > = 1
113113 assert root .find ('IsTruncated' ).text == "false"
114114
115115
Original file line number Diff line number Diff line change 1- import subprocess
21import time
2+ import multiprocessing
33
44import boto3
55import pytest
88from x2s3 .app import create_app
99from x2s3 .settings import Target , Settings
1010
11+ # Set the start method to spawn to avoid pickling issues
12+ multiprocessing .set_start_method ('spawn' , force = True )
13+
1114PORT = 12392
1215
13- @pytest .fixture (scope = "module" )
1416def get_settings ():
1517 settings = Settings ()
1618 settings .targets = [
@@ -22,16 +24,13 @@ def get_settings():
2224 return settings
2325
2426
25- import multiprocessing
26- import uvicorn
27+ def run_server ():
28+ import uvicorn
29+ app = create_app (get_settings )
30+ uvicorn .run (app , host = "0.0.0.0" , port = PORT )
2731
2832@pytest .fixture (scope = "module" )
29- def app (get_settings ):
30- app = create_app (get_settings )
31-
32- def run_server ():
33- uvicorn .run (app , host = "0.0.0.0" , port = PORT )
34-
33+ def app ():
3534 process = multiprocessing .Process (target = run_server )
3635 process .start ()
3736 time .sleep (2 ) # Give the server a moment to start
@@ -70,7 +69,7 @@ def test_list_objects_delimiter(app, s3_client):
7069 assert response ['ResponseMetadata' ]['HTTPStatusCode' ] == 200
7170 assert response ['Name' ] == 'janelia-data-examples'
7271 assert response ['Delimiter' ] == '/'
73- assert len (response ['CommonPrefixes' ]) = = 1
72+ assert len (response ['CommonPrefixes' ]) > = 1
7473 assert response ['IsTruncated' ] is False
7574
7675
You can’t perform that action at this time.
0 commit comments