Add very basic test for stats worker
This commit is contained in:
parent
13922fd194
commit
0629a13da2
1 changed files with 15 additions and 0 deletions
15
workers/globalpromstats/test/test_globalpromstats.py
Normal file
15
workers/globalpromstats/test/test_globalpromstats.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
from mock import patch, Mock
|
||||||
|
|
||||||
|
from workers.globalpromstats.globalpromstats import GlobalPrometheusStatsWorker
|
||||||
|
|
||||||
|
from test.fixtures import *
|
||||||
|
|
||||||
|
def test_reportstats(initialized_db):
|
||||||
|
mock = Mock()
|
||||||
|
with patch('workers.globalpromstats.globalpromstats.metric_queue', mock):
|
||||||
|
worker = GlobalPrometheusStatsWorker()
|
||||||
|
worker._report_stats()
|
||||||
|
|
||||||
|
mock.repository_count.Set.assert_called_once()
|
||||||
|
mock.org_count.Set.assert_called_once()
|
||||||
|
mock.robot_count.Set.assert_called_once()
|
Reference in a new issue