Loading [MathJax]/extensions/TeX/AMSsymbols.js
LAL 7.7.0.1-00ddc7f
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
utils_cache_verify.py
Go to the documentation of this file.
1import doctest
2import filecmp
3import os
4import sys
5import unittest
6
7from lal.utils import cache
8
9
10#
11# Define the components of the test suite.
12#
13
14
15class 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
31suite = unittest.TestSuite()
32suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(test_docstrings))
33
34sys.exit(not unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful())