示例#1
0
 def test_level_filter_test(self):
     """Test matching within AddressFilter.LevelFilter."""
     level_filter = AddressFilter.LevelFilter("2,4,8-10,13")
     assert not level_filter.match(1)
     assert level_filter.match(2)
     assert not level_filter.match(3)
     assert level_filter.match(4)
     assert not level_filter.match(5)
     assert level_filter.match(9)
示例#2
0
 def test_level_filter_test(self):
     """Test matching within AddressFilter.LevelFilter."""
     lf = AddressFilter.LevelFilter("2,4,8-10,13")
     self.assertFalse(lf.match(1))
     self.assertTrue(lf.match(2))
     self.assertFalse(lf.match(3))
     self.assertTrue(lf.match(4))
     self.assertFalse(lf.match(5))
     self.assertTrue(lf.match(9))