def test_parse_setheaders(self): x = setheaders.parse_setheader("/foo/bar/voing") assert x == ("foo", "bar", "voing") x = setheaders.parse_setheader("/foo/bar/vo/ing/") assert x == ("foo", "bar", "vo/ing/") x = setheaders.parse_setheader("/bar/voing") assert x == (".*", "bar", "voing") tutils.raises("invalid replacement", setheaders.parse_setheader, "/")
def test_parse_setheaders(self): x = setheaders.parse_setheader("/foo/bar/voing") assert x == ("foo", "bar", "voing") x = setheaders.parse_setheader("/foo/bar/vo/ing/") assert x == ("foo", "bar", "vo/ing/") x = setheaders.parse_setheader("/bar/voing") assert x == (".*", "bar", "voing") with pytest.raises(Exception, match="Invalid replacement"): setheaders.parse_setheader("/")
def setheaders(self): data = [] for d in self.master.options.setheaders: if isinstance(d, str): data.append(setheaders.parse_setheader(d)) else: data.append(d) self.master.view_grideditor( grideditor.SetHeadersEditor( self.master, data, self.master.options.setter("setheaders")))
def setheaders(self): data = [] for d in self.master.options.setheaders: if isinstance(d, str): data.append(setheaders.parse_setheader(d)) else: data.append(d) self.master.view_grideditor( grideditor.SetHeadersEditor( self.master, data, self.master.options.setter("setheaders") ) )