Example #1
0
 def test_Link_negated2(self):
     null = open(os.devnull, 'w')
     t_stdout = sys.stdout
     sys.stdout = null
     options = {'dport': '101', 'proto': 'tcp'}
     self.assertEqual(
         link.link(self.input6[0], self.input6[1],
                   sorted(glob.glob(self.files_all)), options),
         self.results_negated2)
     sys.stdout = t_stdout
Example #2
0
 def test_Link_all(self):
     null = open(os.devnull, 'w')
     t_stdout = sys.stdout
     sys.stdout = null
     options = {'dport': '80', 'proto': 'tcp', 'showallmatches': True}
     self.assertEqual(
         link.link(self.input2[0], self.input2[1],
                   sorted(glob.glob(self.files_all)), options),
         self.results_all)
     sys.stdout = t_stdout
Example #3
0
 def test_Link_ignore_line(self):
     null = open(os.devnull, 'w')
     t_stdout = sys.stdout
     sys.stdout = null
     options = {
         'dport': '443',
         'proto': 'tcp',
         'showallmatches': True,
         'ignore-line': 'term testt6'
     }
     self.assertEqual(
         link.link(self.input4[0], self.input4[1],
                   sorted(glob.glob(self.files_all)), options),
         self.results_ignore_line)
     sys.stdout = t_stdout
Example #4
0
 def test_Link_ncl_basic(self):
     self.assertEqual(
         link.link(self.input1[0], self.input1[1],
                   glob.glob(self.files_ncl), {}), self.results_ncl_basic)
Example #5
0
 def test_Link_ftg_basic(self):
     options = {'dport': '443', 'proto': 'tcp'}
     self.assertEqual(
         link.link(self.input3[0], self.input3[1],
                   glob.glob(self.files_ftg), options),
         self.results_ftg_basic1)