예제 #1
0
 def test_filter_results4(self):
     """Tests filter results where we have success from both of the filters."""
     expected_results = [self.sagan_results[3]]
     filters = [
         FilterFactory.create("asn_v6", "4446"),
         FilterFactory.create("country_code", "NL")
     ]
     self.assertEqual(filter_results(filters, self.sagan_results),
                      expected_results)
예제 #2
0
 def test_filter_results4(self):
     """Tests filter results where we have success from both of the filters."""
     expected_results = [self.sagan_results[3]]
     filters = [
         FilterFactory.create("asn_v6", "4446"),
         FilterFactory.create("country_code", "NL")
     ]
     self.assertEqual(
         filter_results(filters, self.sagan_results), expected_results
     )
예제 #3
0
 def test_filter_results2(self):
     """Tests filter results where we have no results match with multiple filters."""
     expected_results = []
     filters = [
         FilterFactory.create("asn", 3336),
         FilterFactory.create("country_code", "DK"),
         FilterFactory.create("asn_v6", "3")
     ]
     self.assertEqual(filter_results(filters, self.sagan_results),
                      expected_results)
예제 #4
0
 def test_filter_results2(self):
     """Tests filter results where we have no results match with multiple filters."""
     expected_results = []
     filters = [
         FilterFactory.create("asn", 3336),
         FilterFactory.create("country_code", "DK"),
         FilterFactory.create("asn_v6", "3")
     ]
     self.assertEqual(
         filter_results(filters, self.sagan_results), expected_results
     )
예제 #5
0
 def test_filter_results1(self):
     """Tests filter results where we have 3 results match with 2 filters."""
     expected_results = [
         self.sagan_results[0], self.sagan_results[2], self.sagan_results[3]
     ]
     filters = [
         FilterFactory.create("asn", 3337),
         FilterFactory.create("country_code", "NL")
     ]
     self.assertEqual(filter_results(filters, self.sagan_results),
                      expected_results)
예제 #6
0
 def test_filter_results1(self):
     """Tests filter results where we have 3 results match with 2 filters."""
     expected_results = [
         self.sagan_results[0], self.sagan_results[2], self.sagan_results[3]
     ]
     filters = [
         FilterFactory.create("asn", 3337),
         FilterFactory.create("country_code", "NL")
     ]
     self.assertEqual(
         filter_results(filters, self.sagan_results), expected_results
     )
예제 #7
0
 def test_factory_create(self):
     """Test factory create."""
     self.assertIsInstance(FilterFactory.create("country", "GR"), Filter)
     self.assertIsInstance(FilterFactory.create("asn", "3333"), ASNFilter)
예제 #8
0
 def test_factory_create(self):
     """Test factory create."""
     self.assertIsInstance(FilterFactory.create("country", "GR"), Filter)
     self.assertIsInstance(FilterFactory.create("asn", "3333"), ASNFilter)