mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
test_counts: Add test to do_incremental_logging_stat.
Adds an test, to count the number of database queries made by `do_incremental_logging_stat` function.
This commit is contained in:
@@ -1324,6 +1324,11 @@ class TestDoIncrementLoggingStat(AnalyticsTestCase):
|
|||||||
do_increment_logging_stat(self.default_realm, stat, None, self.TIME_ZERO)
|
do_increment_logging_stat(self.default_realm, stat, None, self.TIME_ZERO)
|
||||||
self.assertTableState(RealmCount, ["value"], [[3]])
|
self.assertTableState(RealmCount, ["value"], [[3]])
|
||||||
|
|
||||||
|
def test_do_increment_logging_start_query_count(self) -> None:
|
||||||
|
stat = LoggingCountStat("test", RealmCount, CountStat.DAY)
|
||||||
|
with self.assert_database_query_count(2):
|
||||||
|
do_increment_logging_stat(self.default_realm, stat, None, self.TIME_ZERO)
|
||||||
|
|
||||||
|
|
||||||
class TestLoggingCountStats(AnalyticsTestCase):
|
class TestLoggingCountStats(AnalyticsTestCase):
|
||||||
def test_aggregation(self) -> None:
|
def test_aggregation(self) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user