-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
30 lines (24 loc) · 720 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import unittest
import redis
import os
import time
from cli import RedisCli
class IntegrationTestRedis(unittest.TestCase):
def test_set_keys(self):
cli = RedisCli()
self.assertTrue(cli.set_keys())
def test_get_all_keys(self):
cli = RedisCli()
cli.delete_all_keys()
for x in range(10):
cli.set_keys()
all_keys = cli.get_all_keys()
self.assertEqual(len(all_keys), 10)
self.assertEqual(type(all_keys), list)
def test_delete_all_keys(self):
cli = RedisCli()
self.assertTrue(cli.delete_all_keys())
self.assertEqual(len(cli.get_all_keys()), 0)
if __name__ == '__main__':
time.sleep(4)
unittest.main()