Coverage for tests/test_simple.py: 60%
Shortcuts on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
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"""
7import unittest
8import os
11class SimplestPossibleTestCase(unittest.TestCase):
12 """Tests that don't rely on any external code."""
14 def testSimple(self):
15 self.assertEqual(2 + 2, 4)
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]}")
25if __name__ == "__main__": 25 ↛ 26line 25 didn't jump to line 26, because the condition on line 25 was never true
26 unittest.main()