3030)
3131from tests .helpers import generate_service_mount
3232
33- service_file = "/tests/static/service.zip"
3433service_name = "test"
3534
3635
3736@pytest .mark .asyncio
38- async def test_foxx (db , bad_db , skip_tests ):
37+ async def test_foxx (db , bad_db , skip_tests , foxx_path ):
3938 if "foxx" in skip_tests :
4039 pytest .skip ("Skipping Foxx tests" )
4140
@@ -90,7 +89,7 @@ async def test_foxx(db, bad_db, skip_tests):
9089 # Service as a path
9190 mount1 = generate_service_mount ()
9291 service1 = {
93- "source" : service_file ,
92+ "source" : foxx_path ,
9493 "configuration" : {"LOG_LEVEL" : "info" },
9594 "dependencies" : {},
9695 }
@@ -102,7 +101,7 @@ async def test_foxx(db, bad_db, skip_tests):
102101 service2 = aiohttp .FormData ()
103102 service2 .add_field (
104103 "source" ,
105- open (f".{ service_file } " , "rb" ),
104+ open (f".{ foxx_path } " , "rb" ),
106105 filename = "service.zip" ,
107106 content_type = "application/zip" ,
108107 )
@@ -115,7 +114,7 @@ async def test_foxx(db, bad_db, skip_tests):
115114
116115 # Service as raw data
117116 mount3 = generate_service_mount ()
118- async with aiofiles .open (f".{ service_file } " , mode = "rb" ) as f :
117+ async with aiofiles .open (f".{ foxx_path } " , mode = "rb" ) as f :
119118 service3 = await f .read ()
120119 service_info = await db .foxx .create_service (
121120 mount = mount3 , service = service3 , headers = {"content-type" : "application/zip" }
@@ -127,14 +126,14 @@ async def test_foxx(db, bad_db, skip_tests):
127126
128127 # Replace service
129128 service4 = {
130- "source" : service_file ,
129+ "source" : foxx_path ,
131130 "configuration" : {"LOG_LEVEL" : "info" },
132131 "dependencies" : {},
133132 }
134133 service_info = await db .foxx .replace_service (mount = mount2 , service = service4 )
135134 assert service_info ["mount" ] == mount2
136135
137- async with aiofiles .open (f".{ service_file } " , mode = "rb" ) as f :
136+ async with aiofiles .open (f".{ foxx_path } " , mode = "rb" ) as f :
138137 service5 = await f .read ()
139138 service_info = await db .foxx .replace_service (
140139 mount = mount1 , service = service5 , headers = {"content-type" : "application/zip" }
@@ -143,7 +142,7 @@ async def test_foxx(db, bad_db, skip_tests):
143142
144143 # Update service
145144 service6 = {
146- "source" : service_file ,
145+ "source" : foxx_path ,
147146 "configuration" : {"LOG_LEVEL" : "debug" },
148147 "dependencies" : {},
149148 }
0 commit comments