| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | import sys |
||
| 8 | class TestProgramPathProvider(TestCase): |
||
| 9 | |||
| 10 | def test_default_path(self): |
||
| 11 | """ |
||
| 12 | If the user installed the application into the default directory |
||
| 13 | it is in "C:/Program Files/Rainmeter" |
||
| 14 | """ |
||
| 15 | default_program_path = program_path_provider._get_rainmeter_path_from_default_path() |
||
| 16 | |||
| 17 | self.assertEqual(default_program_path, "C:\\Program Files\\Rainmeter") |
||
| 18 | |||
| 19 | def test_from_registry(self): |
||
| 20 | """ |
||
| 21 | Upon normal installation it will leave a registry entry to detect. |
||
| 22 | We can use this to find the actual Rainmeter. |
||
| 23 | Since we use the default installation path, there should no difference |
||
| 24 | """ |
||
| 25 | registry_program_path = program_path_provider._get_rainmeter_path_from_registry() |
||
| 26 | |||
| 27 | self.assertEqual(registry_program_path, "C:\\Program Files\\Rainmeter") |
||
| 28 | |||
| 29 | def test_overall(self): |
||
| 30 | """ |
||
| 31 | Per default we install it onto "C:/Program Files/Rainmeter" |
||
| 32 | but since we use the path internally we already add / to it |
||
| 33 | and python internal path uses \\ instead windows / |
||
| 34 | """ |
||
| 35 | program_path = program_path_provider.get_cached_program_path() |
||
| 36 | |||
| 37 | self.assertEqual(program_path, "C:\\Program Files\\Rainmeter\\") |
||
| 38 |