Esempio n. 1
0
 def test_invalid_schema_url(self, url):
     with self.assertRaises(SystemExit):
         with StringIO() as buf, redirect_stdout(buf):
             main(args=[url])
             self.assertEqual(
                 buf.getvalue(),
                 'Invalid URL {url}. Please correct the URL and try again\n'
             )
Esempio n. 2
0
 def test_version_with_other_arg(self):
     """Tests --version argument with other"""
     with StringIO() as buf, redirect_stdout(buf):
         with self.assertRaises(SystemExit):
             reader.main(args=[
                 '--date20210527',
                 '--version',
             ])
             self.assertEqual(buf.getvalue(), 'Version 1.0\n')
Esempio n. 3
0
 def test_negative_limit(self, lim):
     with self.assertRaises(SystemExit):
         with StringIO() as buf, redirect_stdout(buf):
             main(args=[
                 'src',
                 '--limit',
                 lim,
             ])
             self.assertEqual(
                 buf.getvalue(),
                 'Invalid limit value. Please correct the limit value and try again\n'
             )