Пример #1
0
 def test_parse_with_users(self):
     ul = user.user_list()
     ufile = cli_mock.create_file('user0\nuser3\nuser4\n')
     sys.argv = ['atest', 'user1', '--ulist', ufile.name, 'user3']
     (options, leftover) = ul.parse()
     self.assertEqualNoOrder(['user0', 'user1', 'user3', 'user4'], ul.users)
     self.assertEqual(leftover, [])
     ufile.clean()
Пример #2
0
 def test_parse_with_users(self):
     ul = user.user_list()
     ufile = cli_mock.create_file('user0\nuser3\nuser4\n')
     sys.argv = ['atest', 'user1', '--ulist', ufile.name, 'user3']
     (options, leftover) = ul.parse()
     self.assertEqualNoOrder(['user0', 'user1', 'user3', 'user4'],
                             ul.users)
     self.assertEqual(leftover, [])
     ufile.clean()
Пример #3
0
 def test_parse_with_access_level(self):
     ul = user.user_list()
     sys.argv = ['atest', '--access_level', '3']
     (options, leftover) = ul.parse()
     self.assertEqual('3', ul.access_level)
     self.assertEqual(leftover, [])
Пример #4
0
 def test_parse_with_acl(self):
     ul = user.user_list()
     sys.argv = ['atest', '--acl', 'acl0']
     (options, leftover) = ul.parse()
     self.assertEqual('acl0', ul.acl)
     self.assertEqual(leftover, [])
Пример #5
0
 def test_parse_user_not_required(self):
     ul = user.user_list()
     sys.argv = ['atest']
     (options, leftover) = ul.parse()
     self.assertEqual([], ul.users)
     self.assertEqual([], leftover)
Пример #6
0
 def test_parse_with_access_level(self):
     ul = user.user_list()
     sys.argv = ['atest', '--access_level', '3']
     (options, leftover) = ul.parse()
     self.assertEqual('3', ul.access_level)
     self.assertEqual(leftover, [])
Пример #7
0
 def test_parse_with_acl(self):
     ul = user.user_list()
     sys.argv = ['atest', '--acl', 'acl0']
     (options, leftover) = ul.parse()
     self.assertEqual('acl0', ul.acl)
     self.assertEqual(leftover, [])
Пример #8
0
 def test_parse_user_not_required(self):
     ul = user.user_list()
     sys.argv = ['atest']
     (options, leftover) = ul.parse()
     self.assertEqual([], ul.users)
     self.assertEqual([], leftover)