mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
tests: Add 100% test coverage to zerver/apps.py.
Tweaked by tabbott to rename to test_cache.py and remove the sender_name argument (Since it was kinda confusing).
This commit is contained in:
committed by
Tim Abbott
parent
1f837340d1
commit
607cab2a53
@@ -63,7 +63,6 @@ not_yet_fully_covered = {
|
||||
'zerver/lib/upload.py',
|
||||
# Other lib files that ideally would coverage, but aren't sorted
|
||||
'zerver/__init__.py',
|
||||
'zerver/apps.py',
|
||||
'zerver/filters.py',
|
||||
'zerver/middleware.py',
|
||||
'zerver/storage.py',
|
||||
|
||||
13
zerver/tests/test_cache.py
Normal file
13
zerver/tests/test_cache.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from mock import Mock, patch
|
||||
|
||||
from zerver.apps import flush_cache
|
||||
from zerver.lib.test_classes import ZulipTestCase
|
||||
|
||||
class AppsTest(ZulipTestCase):
|
||||
def test_cache_gets_flushed(self) -> None:
|
||||
with patch('zerver.apps.logging.info') as mock_logging:
|
||||
with patch('zerver.apps.cache.clear') as mock:
|
||||
# The argument to flush_cache doesn't matter
|
||||
flush_cache(Mock())
|
||||
mock.assert_called_once()
|
||||
mock_logging.assert_called_once()
|
||||
Reference in New Issue
Block a user