Skipped windows incompatible tests

This commit is contained in:
Kamil
2020-05-01 01:17:50 +02:00
parent f566963780
commit e728828a3e

View File

@@ -20,6 +20,7 @@ import json
import os.path
import unittest
import pathlib
import sys
import tempfile
import xmldiff.main
@@ -78,12 +79,14 @@ class TestEmbedImage(unittest.TestCase):
'expected an image, got "text"'):
pybadges._embed_image('http://www.google.com/')
@unittest.skipIf(sys.platform.startswith("win"), "requires Unix filesystem")
def test_svg_file_path(self):
image_path = os.path.abspath(
os.path.join(TEST_DIR, 'golden-images', 'build-failure.svg'))
self.assertRegex(pybadges._embed_image(image_path),
r'^data:image/svg(\+xml)?;base64,')
@unittest.skipIf(sys.platform.startswith("win"), "requires Unix filesystem")
def test_png_file_path(self):
with tempfile.NamedTemporaryFile() as png:
png.write(PNG_IMAGE)
@@ -91,6 +94,7 @@ class TestEmbedImage(unittest.TestCase):
self.assertEqual(pybadges._embed_image(png.name),
'data:image/png;base64,' + PNG_IMAGE_B64)
@unittest.skipIf(sys.platform.startswith("win"), "requires Unix filesystem")
def test_unknown_type_file_path(self):
with tempfile.NamedTemporaryFile() as non_image:
non_image.write(b'Hello')
@@ -99,6 +103,7 @@ class TestEmbedImage(unittest.TestCase):
'not able to determine file type'):
pybadges._embed_image(non_image.name)
@unittest.skipIf(sys.platform.startswith("win"), "requires Unix filesystem")
def test_text_file_path(self):
with tempfile.NamedTemporaryFile(suffix='.txt') as non_image:
non_image.write(b'Hello')