diff --git a/tests/tests.py b/tests/tests.py new file mode 100644 index 0000000..32dfcc5 --- /dev/null +++ b/tests/tests.py @@ -0,0 +1,22 @@ +import os +import sys +import unittest +import tempfile + +samples_dir = os.path.join(sys.path[0], "sample_configs") +CONFIG_FILES = list(os.path.join(samples_dir, file) for file in os.listdir(samples_dir)) + + +class ReadWriteTest(unittest.TestCase): + def setUp(self): + self.write_file = tempfile.TemporaryFile(mode="r+") + + def tearDown(self): + self.write_file.close() + + +class TestTempFile(ReadWriteTest): + def test_me(self): + self.write_file.write("hello") + self.write_file.seek(0) + self.assertEqual(self.write_file.read(), "hello")