Beispiel #1
0
 def test_parse_hook(self):
     x = replace.parse_hook("/foo/bar/voing")
     assert x == ("foo", "bar", "voing")
     x = replace.parse_hook("/foo/bar/vo/ing/")
     assert x == ("foo", "bar", "vo/ing/")
     x = replace.parse_hook("/bar/voing")
     assert x == (".*", "bar", "voing")
     tutils.raises("invalid replacement", replace.parse_hook, "/")
Beispiel #2
0
 def test_parse_hook(self):
     x = replace.parse_hook("/foo/bar/voing")
     assert x == ("foo", "bar", "voing")
     x = replace.parse_hook("/foo/bar/vo/ing/")
     assert x == ("foo", "bar", "vo/ing/")
     x = replace.parse_hook("/bar/voing")
     assert x == (".*", "bar", "voing")
     with pytest.raises(Exception, match="Invalid replacement"):
         replace.parse_hook("/")
Beispiel #3
0
 def test_parse_hook(self):
     x = replace.parse_hook("/foo/bar/voing")
     assert x == ("foo", "bar", "voing")
     x = replace.parse_hook("/foo/bar/vo/ing/")
     assert x == ("foo", "bar", "vo/ing/")
     x = replace.parse_hook("/bar/voing")
     assert x == (".*", "bar", "voing")
     with pytest.raises(Exception, match="Invalid replacement"):
         replace.parse_hook("/")
Beispiel #4
0
 def replacepatterns(self):
     data = []
     for d in self.master.options.replacements:
         if isinstance(d, str):
             data.append(replace.parse_hook(d))
         else:
             data.append(d)
     self.master.view_grideditor(
         grideditor.ReplaceEditor(
             self.master, data, self.master.options.setter("replacements")))
Beispiel #5
0
 def replacepatterns(self):
     data = []
     for d in self.master.options.replacements:
         if isinstance(d, str):
             data.append(replace.parse_hook(d))
         else:
             data.append(d)
     self.master.view_grideditor(
         grideditor.ReplaceEditor(
             self.master,
             data,
             self.master.options.setter("replacements")
         )
     )