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)
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)
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, "{0!s} ==> {1!s} != {2!s}".format(source, retcls, cls)