Skip to content

Commit db6385b

Browse files
do not test logs
1 parent 6754200 commit db6385b

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

utils/tests/test_app_utils.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,19 @@ def test_2(self):
3131
self.assertDictEqual(expected_output, output)
3232

3333
def test_3(self):
34-
expected_logs = ['INFO:test_3_log:Session {} logout user'.format(self.session_id)]
3534
expected_output = [components.SuccessLogoutAlert(), components.UserPortalCardBody(None)]
3635
expected_output = [json.loads(json.dumps(x, cls=plotly.utils.PlotlyJSONEncoder)) for x in expected_output]
3736
expected_cache = {b'id': cache_utils.compress_data(self.session_id)}
3837
cache_utils.store_fname(self.cache, self.session_id, 'dummy_fname_1', 'contact')
3938
self.cache.hset(self.session_id, 'user', 'username')
4039
self.cache.hset(self.session_id, 'session_pkid', '123')
4140

42-
with self.assertLogs('test_3_log', level='INFO') as log:
43-
test_log = logging.getLogger('test_3_log')
44-
output = app_utils.user_logout(self.session_id, self.cache, test_log)
45-
self.assertEqual(output[0], no_update)
46-
output = [json.loads(json.dumps(x, cls=plotly.utils.PlotlyJSONEncoder)) for x in output[1:]]
47-
self.assertListEqual(output, expected_output)
48-
self.assertDictEqual(expected_cache, self.cache.hgetall(self.session_id))
41+
test_log = logging.getLogger('test_3_log')
42+
output = app_utils.user_logout(self.session_id, self.cache, test_log)
43+
self.assertEqual(output[0], no_update)
44+
output = [json.loads(json.dumps(x, cls=plotly.utils.PlotlyJSONEncoder)) for x in output[1:]]
45+
self.assertListEqual(output, expected_output)
46+
self.assertDictEqual(expected_cache, self.cache.hgetall(self.session_id))
4947

5048

5149
if __name__ == '__main__':

utils/tests/test_cache_utils.py

+8
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,11 @@ def test_8(self):
7676
cache_utils.clear_cache(self.session_id, self.cache)
7777
expected = {b'id': cache_utils.compress_data(self.session_id)}
7878
self.assertDictEqual(expected, self.cache.hgetall(self.session_id))
79+
80+
def test_(self):
81+
82+
cache_utils.store_density(self.session_id, density_cachekey, density, self.cache)
83+
cache_utils.store_density()
84+
cache_utils.retrieve_density()
85+
cache_utils.remove_density()
86+
cache_utils.remove_all_density()

0 commit comments

Comments
 (0)