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, "/")
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("/")
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("/")
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")))
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") ) )