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()
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, [])
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, [])
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)