mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-05-18 15:20:51 +02:00
tests: Remove hacky test'
This commit is contained in:
parent
abd38ae56f
commit
eadcb3bfd3
@ -1,7 +1,6 @@
|
|||||||
"""Test export functions."""
|
"""Test export functions."""
|
||||||
import unittest
|
import unittest
|
||||||
import unittest.mock
|
import unittest.mock
|
||||||
import io
|
|
||||||
import shutil
|
import shutil
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -53,20 +52,5 @@ class TestExportColors(unittest.TestCase):
|
|||||||
self.is_file_contents(tmp_file, " --background: #1F211E;")
|
self.is_file_contents(tmp_file, " --background: #1F211E;")
|
||||||
|
|
||||||
|
|
||||||
class TestInvalidExport(unittest.TestCase):
|
|
||||||
"""Test export function error handling."""
|
|
||||||
|
|
||||||
def test_invalid_template(self):
|
|
||||||
"""> Test template validation."""
|
|
||||||
error_msg = "warning: template 'dummy' doesn't exist."
|
|
||||||
tmp_file = os.path.join(TMP_DIR, "test.css")
|
|
||||||
|
|
||||||
# Since this function prints a message on fail we redirect
|
|
||||||
# it's output so that we can read it.
|
|
||||||
with unittest.mock.patch('sys.stdout', new=io.StringIO()) as fake_out:
|
|
||||||
export.color(COLORS, "dummy", tmp_file)
|
|
||||||
self.assertEqual(fake_out.getvalue().strip(), error_msg)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
Reference in New Issue
Block a user