You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
628 B

  1. import os
  2. import sys
  3. import unittest
  4. import tempfile
  5. samples_dir = os.path.join(sys.path[0], "sample_configs")
  6. CONFIG_FILES = dict(
  7. (file, os.path.join(samples_dir, file)) for file in os.listdir(samples_dir)
  8. )
  9. class ReadWriteTest(unittest.TestCase):
  10. def setUp(self):
  11. self.write_file = tempfile.TemporaryFile(mode="r+")
  12. def tearDown(self):
  13. self.write_file.close()
  14. class TestTempFile(ReadWriteTest):
  15. def test_me(self):
  16. self.write_file.write("hello")
  17. self.write_file.seek(0)
  18. self.assertEqual(self.write_file.read(), "hello")
  19. class TestParser(ReadWriteTest):
  20. pass