Esempio n. 1
0
 def test_main_filter_date_format_sep_bad(self):
     se = '2017-06-20', '2017-06-21'
     s_e = 'P'.join(se)
     string_list = (
         '--cvrf --product foo --first_published {}'.format(s_e).split())
     with self.assertRaises(SystemExit) as e:
         main.main(string_list)
     self.assertEqual(e.exception.code, 2)
Esempio n. 2
0
 def test_main_filter_forbidden_by_api(self):
     se = '2017-06-20', '2017-06-21'
     s_e = DATE_SEP_TOKEN.join(se)
     string_list = (
         '--cvrf --product foo --first_published {}'.format(s_e).split())
     with self.assertRaises(SystemExit) as e:
         main.main(string_list)
     self.assertEqual(e.exception.code, 2)
Esempio n. 3
0
 def test_main_unknown_adv_format(self):
     string_list = '--unknown'.split()
     with self.assertRaises(SystemExit) as e:
         main.main(string_list)
     self.assertEqual(e.exception.code, 2)
Esempio n. 4
0
 def test_main_smoke_help_short(self):
     with self.assertRaises(SystemExit) as e:
         main.main(['-h'])
     self.assertEqual(e.exception.code, 0)
Esempio n. 5
0
 def test_main_missing_adv_format(self):
     string_list = '--severity critical'.split()
     with self.assertRaises(SystemExit) as e:
         main.main(string_list)
     self.assertEqual(e.exception.code, 2)
Esempio n. 6
0
 def test_main_smoke_user_error(self):
     with self.assertRaises(SystemExit) as e:
         main.main()
     self.assertEqual(e.exception.code, 2)
Esempio n. 7
0
 def test_main_cvrf_version_fails(self):
     string_list = '--cvrf --version 15.5'.split()
     with self.assertRaises(SystemExit) as e:
         main.main(string_list)
     self.assertEqual(e.exception.code, 2)
Esempio n. 8
0
 def test_main_ios_unknown_out_format_fails(self):
     string_list = '--ios \'15.5(2)T1\' --yaml so-what.yaml'.split()
     with self.assertRaises(SystemExit) as e:
         main.main(string_list)
     self.assertEqual(e.exception.code, 2)
Esempio n. 9
0
 def test_main_ios_year_fails(self):
     string_list = '--ios \'15.5(2)T1\' --year 2017'.split()
     with self.assertRaises(SystemExit) as e:
         main.main(string_list)
     self.assertEqual(e.exception.code, 2)
Esempio n. 10
0
 def test_main_ios_advisory_fails(self):
     string_list = '--ios \'15.5(2)T1\' --advisory ontologicalyoff'.split()
     with self.assertRaises(SystemExit) as e:
         main.main(string_list)
     self.assertEqual(e.exception.code, 2)