SessionCache tests depend on logging already being setup

This commit is contained in:
Alan Hamlett 2017-05-21 15:06:39 -07:00
parent 070052f1d6
commit 6325bd3c35

View file

@ -3,6 +3,7 @@
import tempfile
from wakatime.session_cache import SessionCache
from wakatime.logger import setup_logging
from . import utils
@ -14,6 +15,18 @@ class SessionCacheTestCase(utils.TestCase):
['wakatime.offlinequeue.Queue.connect', None],
]
def setUp(self):
class MockArgs(object):
timestamp = 0
is_write = False
entity = ''
version = ''
plugin = ''
verbose = False
logfile = ''
self.args = MockArgs()
setup_logging(self.args, self.args.version)
def test_can_crud_session(self):
with tempfile.NamedTemporaryFile() as fh:
cache = SessionCache()