diff --git a/svgcheck/run.py b/svgcheck/run.py index a553ee0..509a6fd 100644 --- a/svgcheck/run.py +++ b/svgcheck/run.py @@ -107,7 +107,7 @@ def main(): wp.color_threshold = options.grey_level if len(args) < 1: - source = os.getcwd() + "/stdin" + source = "/dev/stdin" else: source = args[0] if not os.path.exists(source): diff --git a/svgcheck/test.py b/svgcheck/test.py index 08a387e..4d98437 100644 --- a/svgcheck/test.py +++ b/svgcheck/test.py @@ -67,6 +67,14 @@ def test_clear_cache(self): None, None) self.assertFalse(os.path.exists('Temp/cache/reference.RFC.1847.xml')) + def test_stdin(self): + process = subprocess.Popen([sys.executable, test_program], + stdin=subprocess.PIPE, + stderr=subprocess.PIPE) + _, stderr_data = process.communicate(input=b"") + self.assertEqual(stderr_data.decode("utf-8").strip(), + 'INFO: File conforms to SVG requirements.') + class TestParserMethods(unittest.TestCase):