-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
key.py
38 lines (35 loc) · 912 Bytes
/
key.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
# Import salt libs
import integration
class KeyTest(integration.CliCase):
'''
Test salt-key script
'''
def test_list(self):
'''
test salt-key -L
'''
data = self.run_key('-L')
expect = [
'\x1b[1;31mUnaccepted Keys:\x1b[0m',
'\x1b[1;32mAccepted Keys:\x1b[0m',
'\x1b[0;32mminion\x1b[0m',
'\x1b[1;34mRejected:\x1b[0m', '']
self.assertEqual(data, expect)
def test_list_acc(self):
'''
test salt-key -l
'''
data = self.run_key('-l acc')
self.assertEqual(
data,
['\x1b[0;32mminion\x1b[0m', '']
)
def test_list_un(self):
'''
test salt-key -l
'''
data = self.run_key('-l un')
self.assertEqual(
data,
['']
)