@@ 111-122 (lines=12) @@ | ||
108 | os.remove(image) |
|
109 | os.rmdir(output_dir) |
|
110 | ||
111 | def test_download_image_with_dirname_and_filename(self): |
|
112 | os.mkdir('output') |
|
113 | output_dir = os.path.join(os.getcwd(), 'output') |
|
114 | image = self.faker.image(dir=output_dir, filename='testing.png') |
|
115 | image_dirname = os.path.dirname(image) |
|
116 | _, file_ext = os.path.splitext(image) |
|
117 | ||
118 | self.assertEqual(output_dir, image_dirname) |
|
119 | self.assertEqual('.png', file_ext) |
|
120 | self.assertTrue(os.path.exists(image)) |
|
121 | os.remove(image) |
|
122 | os.rmdir(output_dir) |
|
123 | ||
124 | def test_download_image_with_exception(self): |
|
125 | pass |
|
@@ 98-109 (lines=12) @@ | ||
95 | self.assertTrue(os.path.exists(gif)) |
|
96 | os.remove(gif) |
|
97 | ||
98 | def test_download_image_with_dirname(self): |
|
99 | os.mkdir('output') |
|
100 | output_dir = os.path.join(os.getcwd(), 'output') |
|
101 | image = self.faker.image(dir=output_dir) |
|
102 | image_dirname = os.path.dirname(image) |
|
103 | _, file_ext = os.path.splitext(image) |
|
104 | ||
105 | self.assertEqual(output_dir, image_dirname) |
|
106 | self.assertEqual('.jpg', file_ext) |
|
107 | self.assertTrue(os.path.exists(image)) |
|
108 | os.remove(image) |
|
109 | os.rmdir(output_dir) |
|
110 | ||
111 | def test_download_image_with_dirname_and_filename(self): |
|
112 | os.mkdir('output') |