-
Notifications
You must be signed in to change notification settings - Fork 216
/
show_coverage.py
110 lines (105 loc) · 3.07 KB
/
show_coverage.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# -*- coding: utf-8 -*-
REDIS_COMMANDS = ('QUIT',
'AUTH',
'EXISTS',
'DELETE', # come on :-)
'TYPE',
'KEYS',
'RANDOMKEY',
'RENAME',
'RENAMENX',
'DBSIZE',
'EXPIRE',
'TTL',
'SELECT',
'MOVE',
'FLUSHDB',
'FLUSHALL',
'SET',
'GET',
'GETSET',
'MGET',
'SETNX',
'SETEX',
'MSET',
'MSETNX',
'INCR',
'INCRBY',
'DECR',
'DECRBY',
'APPEND',
'SUBSTR',
'RPUSH',
'LPUSH',
'LLEN',
'LRANGE',
'LTRIM',
'LINDEX',
'LSET',
'LREM',
'LPOP',
'RPOP',
'BLPOP',
'BRPOP',
'RPOPLPUSH',
'SADD',
'SREM',
'SPOP',
'SMOVE',
'SCARD',
'SISMEMBER',
'SINTER',
'SINTERSTORE',
'SUNION',
'SUNIONSTORE',
'SDIFF',
'SDIFFSTORE',
'SMEMBERS',
'SRANDMEMBER',
'ZADD',
'ZREM',
'ZINCRBY',
'ZRANK',
'ZREVRANK',
'ZRANGE',
'ZREVRANGE',
'ZRANGEBYSCORE',
'ZCARD',
'ZSCORE',
'ZREMRANGEBYRANK',
'ZREMRANGEBYSCORE',
'ZUNIONSTORE',
'ZINTERSTORE',
'HSET',
'HGET',
'HMSET',
'HINCRBY',
'HEXISTS',
'HDEL',
'HLEN',
'HKEYS',
'HVALS',
'HGETALL',
'SORT',
'SUBSCRIBE',
'UNSUBSCRIBE',
'PUBLISH',
'SAVE',
'BGSAVE',
'LASTSAVE',
'SHUTDOWN',
'BGREWRITEAOF',
'INFO',
'SLAVEOF',
'CONFIG')
from brukva import Client
covered_commands = set(c.upper() for c in dir(Client))
uncovered_commands = set(REDIS_COMMANDS).difference(covered_commands)
if __name__ == '__main__':
if not uncovered_commands:
exit(0)
print 'Uncovered commmands:'
for c in sorted(uncovered_commands):
print '\t%s' % c
print 'Commands to cover: %d' % len(uncovered_commands)
print 'Already covered: %d' % len(set(REDIS_COMMANDS).intersection(covered_commands))