From 09676367e365acb115051a9b44183a9be4565648 Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Mon, 4 Oct 2021 12:19:59 +0200 Subject: [PATCH] Refactor curve gauges test (#96) * check if curve token is a gauge deposit * add postgress password to docker, refactor test for curve gauges * add init py to helpers * Set version 3.4.3 Co-authored-by: Uxio Fuentefria --- docker-compose.yml | 2 ++ gnosis/eth/oracles/helpers/__init__.py | 0 gnosis/eth/tests/test_oracles.py | 13 ++++--------- setup.py | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) create mode 100644 gnosis/eth/oracles/helpers/__init__.py diff --git a/docker-compose.yml b/docker-compose.yml index 7b8276738..6267ebcee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,3 +5,5 @@ services: image: postgres:10-alpine ports: - "5432:5432" + environment: + POSTGRES_PASSWORD: postgres diff --git a/gnosis/eth/oracles/helpers/__init__.py b/gnosis/eth/oracles/helpers/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/gnosis/eth/tests/test_oracles.py b/gnosis/eth/tests/test_oracles.py index 937e58aef..1e2b04271 100644 --- a/gnosis/eth/tests/test_oracles.py +++ b/gnosis/eth/tests/test_oracles.py @@ -222,16 +222,11 @@ def test_get_underlying_tokens_gauges(self): # 3crv gauge deposit: dai, usdc, usdt gauge_deposit_address = '0xF5194c3325202F456c95c1Cf0cA36f8475C1949F' - lp_token_underlying_tokens = [ - '0x8e595470Ed749b85C6F7669de83EAe304C2ec68F', - '0x76Eb2FE28b36B3ee97F3Adae0C69606eeDB2A37c', - '0x48759F220ED983dB51fA7A8C0D2AAb8f3ce4166a' - ] + gauge_lp_token_address = '0x5282a4eF67D9C33135340fB3289cc1711c13638C' + gauge_underlying_tokens = curve_oracle.get_underlying_tokens(gauge_deposit_address) + lp_token_underlying_tokens = curve_oracle.get_underlying_tokens(gauge_lp_token_address) - underlying_tokens = curve_oracle.get_underlying_tokens(gauge_deposit_address) - for underlying_token in underlying_tokens: - self.assertIn(underlying_token.address, lp_token_underlying_tokens) - self.assertAlmostEqual(underlying_token.quantity, 0.3, delta=0.5) + self.assertEqual(gauge_underlying_tokens, lp_token_underlying_tokens) class TestZerionComposedOracle(EthereumTestCaseMixin, TestCase): diff --git a/setup.py b/setup.py index 446e4278c..469e10f0f 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ setup( name='gnosis-py', - version='3.4.2', + version='3.4.3', packages=find_packages(), package_data={'gnosis': ['py.typed']}, install_requires=requirements,