Skip to content

Commit 9a31859

Browse files
author
Sergio García Prado
committed
ISSUE #346
* Improve tests.
1 parent 0dc445a commit 9a31859

File tree

30 files changed

+84
-115
lines changed

30 files changed

+84
-115
lines changed

packages/core/minos-microservice-aggregate/tests/test_aggregate/test_entities/test_models/test_root/test_with_postgresql.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
PostgresAsyncTestCase,
1313
)
1414
from tests.utils import (
15-
CONFIG_FILE_PATH,
1615
AggregateTestCase,
1716
Car,
1817
Order,
@@ -22,8 +21,6 @@
2221

2322

2423
class TestExternalEntityWithPostgreSql(AggregateTestCase, PostgresAsyncTestCase):
25-
CONFIG_FILE_PATH = CONFIG_FILE_PATH
26-
2724
def setUp(self):
2825
super().setUp()
2926

packages/core/minos-microservice-aggregate/tests/test_aggregate/test_snapshots/test_pg/test_abc.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99
PostgresAsyncTestCase,
1010
)
1111
from tests.utils import (
12-
CONFIG_FILE_PATH,
1312
AggregateTestCase,
1413
)
1514

1615

1716
class TestPostgreSqlSnapshotSetup(AggregateTestCase, PostgresAsyncTestCase):
18-
CONFIG_FILE_PATH = CONFIG_FILE_PATH
19-
2017
async def test_setup_snapshot_table(self):
2118
async with PostgreSqlSnapshotSetup.from_config(self.config):
2219
async with aiopg.connect(**self.snapshot_db) as connection:

packages/core/minos-microservice-aggregate/tests/test_aggregate/test_snapshots/test_pg/test_api.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,12 @@
2020
PostgresAsyncTestCase,
2121
)
2222
from tests.utils import (
23-
CONFIG_FILE_PATH,
2423
AggregateTestCase,
2524
FakeAsyncIterator,
2625
)
2726

2827

2928
class TestPostgreSqlSnapshotRepository(AggregateTestCase, PostgresAsyncTestCase):
30-
CONFIG_FILE_PATH = CONFIG_FILE_PATH
31-
3229
def setUp(self) -> None:
3330
super().setUp()
3431

packages/core/minos-microservice-aggregate/tests/test_aggregate/test_snapshots/test_pg/test_queries.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@
3434
PostgresAsyncTestCase,
3535
)
3636
from tests.utils import (
37-
CONFIG_FILE_PATH,
37+
AggregateTestCase,
3838
)
3939

4040

41-
class TestPostgreSqlSnapshotQueryBuilder(PostgresAsyncTestCase):
42-
CONFIG_FILE_PATH = CONFIG_FILE_PATH
43-
41+
class TestPostgreSqlSnapshotQueryBuilder(AggregateTestCase, PostgresAsyncTestCase):
4442
def setUp(self) -> None:
4543
super().setUp()
4644
self.classname = "path.to.Product"

packages/core/minos-microservice-aggregate/tests/test_aggregate/test_snapshots/test_pg/test_readers.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@
2525
PostgresAsyncTestCase,
2626
)
2727
from tests.utils import (
28-
CONFIG_FILE_PATH,
2928
AggregateTestCase,
3029
Car,
3130
)
3231

3332

3433
class TestPostgreSqlSnapshotReader(AggregateTestCase, PostgresAsyncTestCase):
35-
CONFIG_FILE_PATH = CONFIG_FILE_PATH
36-
3734
def setUp(self) -> None:
3835
super().setUp()
3936

packages/core/minos-microservice-aggregate/tests/test_aggregate/test_snapshots/test_pg/test_writers.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,12 @@
3333
PostgresAsyncTestCase,
3434
)
3535
from tests.utils import (
36-
CONFIG_FILE_PATH,
3736
AggregateTestCase,
3837
Car,
3938
)
4039

4140

4241
class TestPostgreSqlSnapshotWriter(AggregateTestCase, PostgresAsyncTestCase):
43-
CONFIG_FILE_PATH = CONFIG_FILE_PATH
44-
4542
def setUp(self) -> None:
4643
super().setUp()
4744
self.uuid_1 = uuid4()

packages/core/minos-microservice-aggregate/tests/test_aggregate/test_snapshots/test_services.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
ResponseException,
2727
)
2828
from tests.utils import (
29-
CONFIG_FILE_PATH,
3029
AggregateTestCase,
3130
Order,
3231
)
@@ -35,8 +34,6 @@
3534

3635

3736
class TestSnapshotService(AggregateTestCase, PostgresAsyncTestCase):
38-
CONFIG_FILE_PATH = CONFIG_FILE_PATH
39-
4037
def setUp(self) -> None:
4138
super().setUp()
4239

packages/core/minos-microservice-aggregate/tests/test_aggregate/test_transactions/test_repositories/test_pg.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,11 @@
1919
PostgresAsyncTestCase,
2020
)
2121
from tests.utils import (
22-
CONFIG_FILE_PATH,
2322
AggregateTestCase,
2423
)
2524

2625

2726
class TestPostgreSqlTransactionRepository(AggregateTestCase, PostgresAsyncTestCase):
28-
CONFIG_FILE_PATH = CONFIG_FILE_PATH
29-
3027
def setUp(self) -> None:
3128
super().setUp()
3229

@@ -154,8 +151,6 @@ async def test_submit_rejected_raises(self):
154151

155152

156153
class TestPostgreSqlTransactionRepositorySelect(AggregateTestCase, PostgresAsyncTestCase):
157-
CONFIG_FILE_PATH = CONFIG_FILE_PATH
158-
159154
def setUp(self) -> None:
160155
super().setUp()
161156
self.uuid_1 = uuid4()

packages/core/minos-microservice-aggregate/tests/test_aggregate/test_transactions/test_services.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,12 @@
3131
ResponseException,
3232
)
3333
from tests.utils import (
34-
CONFIG_FILE_PATH,
3534
AggregateTestCase,
3635
FakeAsyncIterator,
3736
)
3837

3938

4039
class TestSnapshotService(AggregateTestCase, PostgresAsyncTestCase):
41-
CONFIG_FILE_PATH = CONFIG_FILE_PATH
42-
4340
def setUp(self) -> None:
4441
super().setUp()
4542

packages/core/minos-microservice-aggregate/tests/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
PoolFactory,
3636
)
3737
from minos.common.testing import (
38-
CommonTestCase,
38+
MinosTestCase,
3939
)
4040
from minos.networks import (
4141
BrokerClientPool,
@@ -47,8 +47,9 @@
4747
CONFIG_FILE_PATH = BASE_PATH / "test_config.yml"
4848

4949

50-
class AggregateTestCase(CommonTestCase, ABC):
51-
CONFIG_FILE_PATH = CONFIG_FILE_PATH
50+
class AggregateTestCase(MinosTestCase, ABC):
51+
def get_config_file_path(self):
52+
return CONFIG_FILE_PATH
5253

5354
def get_injections(self):
5455
pool_factory = PoolFactory.from_config(

0 commit comments

Comments
 (0)