| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """This module is to test the program path provider.""" |
||
| 10 | class TestProgramPathProvider(TestCase): |
||
| 11 | """Need to use a class to extend from TestCase.""" |
||
| 12 | |||
| 13 | def test_default_path(self): |
||
| 14 | r""" |
||
| 15 | If the user installed the application into the default directory. |
||
| 16 | |||
| 17 | it is in "C:/Program Files/Rainmeter" |
||
| 18 | """ |
||
| 19 | default_program_path = PROGRAM_PATH_PROVIDER.get_rm_path_from_default_path() |
||
| 20 | |||
| 21 | self.assertEqual(default_program_path, "C:\\Program Files\\Rainmeter") |
||
| 22 | |||
| 23 | def test_from_registry(self): |
||
| 24 | r""" |
||
| 25 | Upon normal installation it will leave a registry entry to detect. |
||
| 26 | |||
| 27 | We can use this to find the actual Rainmeter. |
||
| 28 | Since we use the default installation path, there should no difference |
||
| 29 | """ |
||
| 30 | registry_program_path = PROGRAM_PATH_PROVIDER.get_rm_path_from_registry() |
||
| 31 | |||
| 32 | self.assertEqual(registry_program_path, "C:\\Program Files\\Rainmeter") |
||
| 33 | |||
| 34 | def test_overall(self): |
||
| 35 | r""" |
||
| 36 | Per default we install it onto "C:/Program Files/Rainmeter". |
||
| 37 | |||
| 38 | But since we use the path internally we already add / to it |
||
| 39 | and python internal path uses \\ instead windows / |
||
| 40 | """ |
||
| 41 | program_path = PROGRAM_PATH_PROVIDER.get_cached_program_path() |
||
| 42 | |||
| 43 | self.assertEqual(program_path, "C:\\Program Files\\Rainmeter\\") |
||
| 44 |