Here are the examples of the python api scrapy.responsetypes.responsetypes.from_filename taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
3
Example 1
def test_from_filename(self):
mappings = [
('data.bin', Response),
('file.txt', TextResponse),
('file.xml.gz', Response),
('file.xml', XmlResponse),
('file.html', HtmlResponse),
('file.unknownext', Response),
]
for source, cls in mappings:
retcls = responsetypes.from_filename(source)
assert retcls is cls, "%s ==> %s != %s" % (source, retcls, cls)