Пример #1
0
 def test_filter_type_host(self):
     ft = get_filter_type_from_string('host')
     self.assertEqual(ft, FilterType.HOST)
Пример #2
0
 def test_filter_type_target(self):
     ft = get_filter_type_from_string('target')
     self.assertEqual(ft, FilterType.TARGET)
Пример #3
0
 def test_filter_type_group(self):
     ft = get_filter_type_from_string('group')
     self.assertEqual(ft, FilterType.GROUP)
Пример #4
0
 def test_filter_type_role(self):
     ft = get_filter_type_from_string('role')
     self.assertEqual(ft, FilterType.ROLE)
Пример #5
0
 def test_filter_type_all_secinfo(self):
     ft = get_filter_type_from_string('all_secinfo')
     self.assertEqual(ft, FilterType.ALL_SECINFO)
Пример #6
0
 def test_filter_type_permission(self):
     ft = get_filter_type_from_string('permission')
     self.assertEqual(ft, FilterType.PERMISSION)
Пример #7
0
 def test_filter_type_report_format(self):
     ft = get_filter_type_from_string('report_format')
     self.assertEqual(ft, FilterType.REPORT_FORMAT)
Пример #8
0
 def test_filter_type_os(self):
     ft = get_filter_type_from_string('os')
     self.assertEqual(ft, FilterType.OPERATING_SYSTEM)
Пример #9
0
 def test_invalid_filter_type(self):
     with self.assertRaises(InvalidArgument):
         get_filter_type_from_string('foo')
Пример #10
0
 def test_filter_type_vulnerability(self):
     ft = get_filter_type_from_string('vulnerability')
     self.assertEqual(ft, FilterType.VULNERABILITY)
Пример #11
0
 def test_filter_type_scan_config(self):
     ft = get_filter_type_from_string('scan_config')
     self.assertEqual(ft, FilterType.SCAN_CONFIG)
Пример #12
0
 def test_filter_type_operating_system(self):
     ft = get_filter_type_from_string('operating_system')
     self.assertEqual(ft, FilterType.OPERATING_SYSTEM)
Пример #13
0
 def test_filter_type_tls_certificate(self):
     ft = get_filter_type_from_string('tls_certificate')
     self.assertEqual(ft, FilterType.TLS_CERTIFICATE)
Пример #14
0
 def test_filter_type_ticket(self):
     ft = get_filter_type_from_string('ticket')
     self.assertEqual(ft, FilterType.TICKET)
Пример #15
0
 def test_filter_type_note(self):
     ft = get_filter_type_from_string('note')
     self.assertEqual(ft, FilterType.NOTE)
Пример #16
0
    def test_non_or_empty_filter_type(self):
        ft = get_filter_type_from_string(None)
        self.assertIsNone(ft)

        ft = get_filter_type_from_string('')
        self.assertIsNone(ft)
Пример #17
0
 def test_filter_type_override(self):
     ft = get_filter_type_from_string('override')
     self.assertEqual(ft, FilterType.OVERRIDE)
Пример #18
0
 def test_filter_type_alert(self):
     ft = get_filter_type_from_string('alert')
     self.assertEqual(ft, FilterType.ALERT)
Пример #19
0
 def test_filter_type_port_list(self):
     ft = get_filter_type_from_string('port_list')
     self.assertEqual(ft, FilterType.PORT_LIST)
Пример #20
0
 def test_filter_type_asset(self):
     ft = get_filter_type_from_string('asset')
     self.assertEqual(ft, FilterType.ASSET)
Пример #21
0
 def test_filter_type_result(self):
     ft = get_filter_type_from_string('result')
     self.assertEqual(ft, FilterType.RESULT)
Пример #22
0
 def test_filter_type_credential(self):
     ft = get_filter_type_from_string('credential')
     self.assertEqual(ft, FilterType.CREDENTIAL)
Пример #23
0
 def test_filter_type_schedule(self):
     ft = get_filter_type_from_string('schedule')
     self.assertEqual(ft, FilterType.SCHEDULE)
Пример #24
0
 def test_filter_type_filter(self):
     ft = get_filter_type_from_string('filter')
     self.assertEqual(ft, FilterType.FILTER)
Пример #25
0
 def test_filter_type_task(self):
     ft = get_filter_type_from_string('task')
     self.assertEqual(ft, FilterType.TASK)
Пример #26
0
 def test_filter_type_agent(self):
     with self.assertRaises(InvalidArgument):
         get_filter_type_from_string('agent')