Skip to content

Commit 86c4e35

Browse files
authored
fix: integration tests (#44)
1 parent a2f9f32 commit 86c4e35

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

tests/integration/conftest.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ def is_docker_running():
2424
"""Checks if docker is running"""
2525
logger.debug("Checking if docker is running...")
2626
client = docker.from_env()
27+
is_running = True
2728
try:
2829
client.info()
29-
return True
3030
except Exception as e:
31-
return False
31+
is_running = False
32+
finally:
33+
client.close()
34+
return is_running
3235

3336

3437
def is_docker_compose_installed():

tests/integration/test_ffs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ def test_grpc_ffs_list_api(pygate_client: PowerGateClient, ffs_instance):
2929

3030

3131
def test_grpc_ffs_add_to_hot(pygate_client: PowerGateClient, ffs_instance):
32-
res = pygate_client.ffs.add_to_hot(test_chunks(), ffs_instance.token)
32+
res = pygate_client.ffs.add_to_hot(chunks(), ffs_instance.token)
3333

3434
assert res is not None
3535
assert res.cid is not None
3636

3737

3838
def test_grpc_ffs_add_then_get_content(pygate_client: PowerGateClient, ffs_instance):
39-
res = pygate_client.ffs.add_to_hot(test_chunks(), ffs_instance.token)
39+
res = pygate_client.ffs.add_to_hot(chunks(), ffs_instance.token)
4040

4141
assert res is not None
4242

@@ -101,6 +101,6 @@ def test_send_fil(pygate_client: PowerGateClient, ffs_instance: CreateResponse):
101101
assert before_receiver_fil.balance < after_receiver_fil.balance
102102

103103

104-
def test_chunks():
104+
def chunks():
105105
for _ in range(1):
106106
yield StageRequest(chunk=bytes("test_content", "ASCII"))

tests/integration/test_wallet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_grpc_wallet_balance(pygate_client: PowerGateClient):
3939

4040
balance_res = pygate_client.wallet.balance(new_res.address)
4141
assert type(balance_res) is BalanceResponse
42-
assert balance_res.balance == 4000000000000000
42+
assert balance_res.balance == 250000000000000000
4343

4444

4545
def test_send_file(pygate_client: PowerGateClient):

0 commit comments

Comments
 (0)