コード例 #1
0
    def test_get_image_data_and_filename_empty_input(self):
        img_data = ''
        img_data, filename = image.get_image_data_and_filename(
            img_data, 'png.png')

        self.assertEqual('', img_data)
        self.assertEqual('png.png', filename)
コード例 #2
0
    def test_get_image_data_and_filename(self):
        uri = 'http://httpbin.org/image/png'
        mock_request(uri, fixture='image1.png')

        img_data, filename = image.get_image_data_and_filename(uri, 'png.png')
        local_data = get_fixture('image1.png', as_binary=True)

        self.assertEqual(local_data, img_data)
        self.assertEqual(filename, 'png')
コード例 #3
0
    def test_get_image_data_and_filename(self):
        uri = 'http://httpbin.org/image/png'
        mock_request(uri, fixture='image1.png')

        img_data, filename = image.get_image_data_and_filename(uri, 'png.png')
        local_data = get_fixture('image1.png', as_binary=True)

        self.assertEqual(local_data, img_data)
        self.assertEqual(filename, 'png')
コード例 #4
0
    def test_get_image_data_and_filename_empty_input(self):
        img_data = ''
        img_data, filename = image.get_image_data_and_filename(img_data, 'png.png')

        self.assertEqual('', img_data)
        self.assertEqual('png.png', filename)