Skip to content

Commit e26426d

Browse files
committed
Update tests
1 parent 018fc60 commit e26426d

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

packages/examples/cvat/recording-oracle/tests/integration/cron/test_process_exchange_oracle_webhooks.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from web3.middleware import SignAndSendRawMiddlewareBuilder
99
from web3.providers.rpc import HTTPProvider
1010

11+
from src.core.config import Config
1112
from src.core.storage import compose_data_bucket_prefix, compose_results_bucket_prefix
1213
from src.core.types import (
1314
ExchangeOracleEventTypes,
@@ -32,7 +33,7 @@
3233
class ServiceIntegrationTest(unittest.TestCase):
3334
def setUp(self):
3435
self.session = SessionLocal()
35-
self.w3 = Web3(HTTPProvider())
36+
self.w3 = Web3(HTTPProvider(Config.localhost.rpc_api))
3637

3738
self.gas_payer = self.w3.eth.account.from_key(DEFAULT_GAS_PAYER_PRIV)
3839
self.w3.middleware_onion.inject(
@@ -193,12 +194,10 @@ def test_process_recording_oracle_webhooks_invalid_escrow_balance(self):
193194
assert updated_webhook.status == OracleWebhookStatuses.pending.value
194195
assert updated_webhook.attempts == 1
195196

196-
@patch("src.chain.escrow.EscrowClient.get_manifest_url")
197-
def test_process_job_launcher_webhooks_invalid_manifest_url(self, mock_manifest_url):
198-
mock_manifest_url.return_value = "invalid_url"
197+
def test_process_job_launcher_webhooks_invalid_manifest_url(self):
199198
escrow_address = create_escrow(self.w3)
200199
fund_escrow(self.w3, escrow_address)
201-
setup_escrow(self.w3, escrow_address)
200+
setup_escrow(self.w3, escrow_address, manifest="http://localhost/invalid/url")
202201

203202
webhook = self.make_webhook(escrow_address)
204203

packages/examples/cvat/recording-oracle/tests/utils/setup_escrow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def create_escrow(web3: Web3):
3232
)
3333

3434

35-
def setup_escrow(web3: Web3, escrow_address: str):
35+
def setup_escrow(web3: Web3, escrow_address: str, *, manifest: str = DEFAULT_MANIFEST_URL):
3636
escrow_client = EscrowClient(web3)
3737
escrow_client.setup(
3838
escrow_address=escrow_address,
@@ -43,7 +43,7 @@ def setup_escrow(web3: Web3, escrow_address: str):
4343
recording_oracle_fee=RECORDING_ORACLE_FEE,
4444
reputation_oracle_address=REPUTATION_ORACLE_ADDRESS,
4545
reputation_oracle_fee=REPUTATION_ORACLE_FEE,
46-
manifest=DEFAULT_MANIFEST_URL,
46+
manifest=manifest,
4747
hash=DEFAULT_HASH,
4848
),
4949
)

0 commit comments

Comments
 (0)