def test_string_filter(self): filters = r"Device\s+name:\s+(?P<dev>.*)" filtered_out = apply_regex_filter(self.blitz_obj, self.str_output, filters) self.assertEqual(filtered_out, {'dev': 'N93_3'}) filters = r"Device\s+name:\s+(?P<dev>NO MATCH)" filtered_out = apply_regex_filter(self.blitz_obj, self.str_output, filters) self.assertEqual(filtered_out, {})
def test_no_filter(self): # with No filter filtered_out = apply_dictionary_filter(self.blitz_obj, output=self.dict_output) self.assertEqual(filtered_out, self.dict_output) filtered_out = apply_regex_filter(self.blitz_obj, output=self.str_output) self.assertEqual(filtered_out, self.str_output)