Coverage for tests/test_simple.py: 60%

11 statements  

« prev     ^ index     » next       coverage.py v6.4.2, created at 2022-08-01 00:45 -0700

1""" 

2Very simple tests to show that the test running 

3infrastructure can run more than one test file. 

4There is nothing scons-specific about these tests. 

5""" 

6 

7import unittest 

8import os 

9 

10 

11class SimplestPossibleTestCase(unittest.TestCase): 

12 """Tests that don't rely on any external code.""" 

13 

14 def testSimple(self): 

15 self.assertEqual(2 + 2, 4) 

16 

17 def testEnvironment(self): 

18 """Test the environment. The test will fail if the tests are run 

19 by anything other than SCons.""" 

20 envVar = "XDG_CACHE_HOME" 

21 self.assertIn(envVar, os.environ) 

22 self.assertTrue(os.path.exists(os.environ[envVar]), f"Check path {os.environ[envVar]}") 

23 

24 

25if __name__ == "__main__": 25 ↛ 26line 25 didn't jump to line 26, because the condition on line 25 was never true

26 unittest.main()