Esempio n. 1
0
 def test_acl_create_parse_no_option(self):
     self.god.mock_io()
     acls = acl.acl_create()
     sys.argv = ['atest']
     sys.exit.expect_call(1).and_raises(cli_mock.ExitException)
     self.assertRaises(cli_mock.ExitException, acls.parse)
     self.god.check_playback()
     self.god.unmock_io()
Esempio n. 2
0
 def test_acl_create_parse_no_option(self):
     self.god.mock_io()
     acls = acl.acl_create()
     sys.argv = ['atest']
     sys.exit.expect_call(1).and_raises(cli_mock.ExitException)
     self.assertRaises(cli_mock.ExitException, acls.parse)
     self.god.check_playback()
     self.god.unmock_io()
Esempio n. 3
0
 def test_acl_create_parse_2_acls(self):
     self.god.mock_io()
     acls = acl.acl_create()
     sys.argv = ['atest', 'acl0', 'acl1', '-desc', 'my_favorite_acl']
     sys.exit.expect_call(1).and_raises(cli_mock.ExitException)
     self.assertRaises(cli_mock.ExitException, acls.parse)
     self.god.check_playback()
     self.god.unmock_io()
Esempio n. 4
0
 def test_acl_create_parse_2_acls(self):
     self.god.mock_io()
     acls = acl.acl_create()
     sys.argv = ['atest', 'acl0', 'acl1',
                 '-desc', 'my_favorite_acl']
     sys.exit.expect_call(1).and_raises(cli_mock.ExitException)
     self.assertRaises(cli_mock.ExitException, acls.parse)
     self.god.check_playback()
     self.god.unmock_io()
Esempio n. 5
0
 def test_acl_create_parse_ok(self):
     acls = acl.acl_create()
     sys.argv = ['atest', 'acl0',
                 '--desc', 'my_favorite_acl']
     acls.parse()
     self.assertEqual('my_favorite_acl', acls.data['description'])
Esempio n. 6
0
 def test_acl_create_parse_ok(self):
     acls = acl.acl_create()
     sys.argv = ['atest', 'acl0',
                 '--desc', 'my_favorite_acl']
     acls.parse()
     self.assertEqual('my_favorite_acl', acls.data['description'])