Skip to content

Commit 3c5f378

Browse files
committed
Foxx tests
1 parent 2a5ccb3 commit 3c5f378

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/test_foxx.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,13 @@ def test_foxx_service_management_json(db, bad_db, cluster, skip_tests, foxx_path
150150
assert err.value.error_code == 3009
151151

152152

153-
def test_foxx_service_management_file(db, cluster, skip_tests, foxx_path):
153+
def test_foxx_service_management_file(db, cluster, skip_tests):
154154
if "foxx" in skip_tests:
155155
pytest.skip("Skipping foxx tests")
156156
if cluster:
157157
pytest.skip("Not tested in a cluster setup")
158158

159+
path = os.path.join(os.path.dirname(__file__), "static", "service.zip")
159160
bad_path = os.path.join(os.path.dirname(__file__), "static", "service")
160161

161162
service_mount = generate_service_mount()
@@ -168,7 +169,7 @@ def test_foxx_service_management_file(db, cluster, skip_tests, foxx_path):
168169
# Test create service by file
169170
service = db.foxx.create_service_with_file(
170171
mount=service_mount,
171-
filename=foxx_path,
172+
filename=path,
172173
development=True,
173174
setup=True,
174175
legacy=True,
@@ -184,7 +185,7 @@ def test_foxx_service_management_file(db, cluster, skip_tests, foxx_path):
184185

185186
# Test create duplicate service
186187
with assert_raises(FoxxServiceCreateError) as err:
187-
db.foxx.create_service_with_file(service_mount, foxx_path)
188+
db.foxx.create_service_with_file(service_mount, path)
188189
assert err.value.error_code == 3011
189190

190191
# Update config and dependencies
@@ -194,7 +195,7 @@ def test_foxx_service_management_file(db, cluster, skip_tests, foxx_path):
194195
# Test update service by file
195196
service = db.foxx.update_service_with_file(
196197
mount=service_mount,
197-
filename=foxx_path,
198+
filename=path,
198199
teardown=False,
199200
setup=False,
200201
legacy=False,
@@ -210,13 +211,13 @@ def test_foxx_service_management_file(db, cluster, skip_tests, foxx_path):
210211

211212
# Test update missing service
212213
with assert_raises(FoxxServiceUpdateError) as err:
213-
db.foxx.update_service_with_file(missing_mount, foxx_path)
214+
db.foxx.update_service_with_file(missing_mount, path)
214215
assert err.value.error_code == 3009
215216

216217
# Test replace service by file
217218
service = db.foxx.replace_service_with_file(
218219
mount=service_mount,
219-
filename=foxx_path,
220+
filename=path,
220221
teardown=True,
221222
setup=True,
222223
legacy=True,
@@ -232,7 +233,7 @@ def test_foxx_service_management_file(db, cluster, skip_tests, foxx_path):
232233

233234
# Test replace missing service
234235
with assert_raises(FoxxServiceReplaceError) as err:
235-
db.foxx.replace_service_with_file(missing_mount, foxx_path)
236+
db.foxx.replace_service_with_file(missing_mount, path)
236237
assert err.value.error_code == 3009
237238

238239
assert db.foxx.delete_service(service_mount, teardown=False) is True

0 commit comments

Comments
 (0)