예제 #1
0
 def test_1_arg_url(self):
     expected_url = 'plugin://plugin.video.helloxbmc/'
     with sys_argv('./addon.py', expected_url):
             opts, mode, url = parse_cli()
             self.assertEqual({}, opts)
             self.assertEqual(Modes.ONCE, mode)
             self.assertEqual(expected_url, url)
예제 #2
0
 def test_1_arg_mode(self):
     for arg, expected_mode in [('iNteractive', Modes.INTERACTIVE),
                       ('onCe', Modes.ONCE), ('crAwl', Modes.CRAWL)]:
         with sys_argv('./addon.py', arg):
             opts, mode, url = parse_cli()
             self.assertEqual({}, opts)
             self.assertEqual(expected_mode, mode)
             self.assertEqual(None, url)
예제 #3
0
 def test_no_args(self):
     with sys_argv('./addon.py'):
         opts, mode, url = parse_cli()
         self.assertEqual(opts, {})
         self.assertEqual(mode, Modes.ONCE)
         self.assertEqual(url, None)