Skip to content

Commit a3fcbe3

Browse files
author
Charles Larivier
committed
test: add test coverage on Metric.list
1 parent 4a2e55b commit a3fcbe3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/resources/test_metric.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,30 @@ def tearDown(self) -> None:
1010
for metric in metrics:
1111
metric.archive()
1212

13+
def test_list(self):
14+
"""Ensure PermissionMembership.list returns a list of PermissionMembership instances."""
15+
# fixture
16+
_ = Metric.create(
17+
name="My Metric",
18+
table_id=1,
19+
definition={
20+
"aggregation": [["count"]],
21+
}
22+
)
23+
_ = Metric.create(
24+
name="My Metric",
25+
table_id=1,
26+
definition={
27+
"aggregation": [["count"]],
28+
}
29+
)
30+
31+
metrics = Metric.list()
32+
33+
self.assertIsInstance(metrics, list)
34+
self.assertEqual(2, len(metrics))
35+
self.assertTrue(all([isinstance(m, Metric) for m in metrics]))
36+
1337
def test_get(self):
1438
"""
1539
Ensure Metric.get returns a Metric instance for a given ID, or

0 commit comments

Comments
 (0)