mirror of https://github.com/zulip/zulip.git
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:
parent
7607969f27
commit
218c7ae8cd
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue