Beispiel #1
0
    def test_directory_uri(self):
        uri = [
            "/",
            "/images"]

        expected = [
            "text/plain",
            "text/plain"]
        for num in xrange(2):
            self.assertEqual(map_uri(uri[num])[1], expected[num])
Beispiel #2
0
    def test_file_uri(self):
        uri = [
            "a_web_page.html",
            "make_time.py",
            "sample.txt"]

        expected = [
            "text/html",
            "text/x-python",
            "text/plain"]
        for num in xrange(3):
            self.assertEqual(map_uri(uri[num])[1], expected[num])
Beispiel #3
0
    def test_map_uri_images(self):
        uri = [
            "/images/JPEG_example.jpg",
            "/images/Sample_Scene_Balls.jpg",
            "/images/sample_1.png"]

        expected = [
            "image/jpeg",
            "image/jpeg",
            "image/png"]

        for num in xrange(3):
            self.assertEqual(map_uri(uri[num])[1], expected[num])