LAL  7.5.0.1-b72065a
utils_cache_verify.py
Go to the documentation of this file.
1 import doctest
2 import filecmp
3 import os
4 import sys
5 import unittest
6 
7 from lal.utils import cache
8 
9 
10 #
11 # Define the components of the test suite.
12 #
13 
14 
15 class test_docstrings(unittest.TestCase):
16  def test(self):
17  failures = doctest.testmod(cache)[0]
18  if failures:
19  sys.exit(bool(failures))
20  cache_rw_is_identity = filecmp.cmp(os.path.join(os.environ.get("LAL_TEST_SRCDIR", "."), "874000000-20000.cache"), "874000000-20000.cache.new")
21  if cache_rw_is_identity:
22  os.remove("874000000-20000.cache.new")
23  self.assertEqual(True, cache_rw_is_identity)
24 
25 
26 #
27 # Construct and run the test suite.
28 #
29 
30 
31 suite = unittest.TestSuite()
32 suite.addTest(unittest.makeSuite(test_docstrings))
33 
34 sys.exit(not unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful())