forked from merlinthered/sublime-rainmeter
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Readded path tests with fixes to the registry path detection
- Loading branch information
Showing
5 changed files
with
75 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
# import sys | ||
import sys | ||
|
||
# from unittest import TestCase | ||
from unittest import TestCase | ||
|
||
# program_drive_provider = sys.modules["Rainmeter.path.program_drive_provider"] | ||
program_drive_provider = sys.modules["Rainmeter.path.program_drive_provider"] | ||
|
||
|
||
# class TestFunctions(TestCase): | ||
class TestFunctions(TestCase): | ||
|
||
# def test_path_program_drive_with_rainmeter_installed_return_drive(self): | ||
# """ | ||
# Per default we install it onto c:/ | ||
# """ | ||
# program_drive = program_drive_provider.get_cached_program_drive() | ||
def test_default_drive(self): | ||
""" | ||
Per default we install it onto c:/ | ||
""" | ||
program_drive = program_drive_provider.get_cached_program_drive() | ||
|
||
# self.assertEqual(program_drive, "C:") | ||
self.assertEqual(program_drive, "C:") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,37 @@ | ||
# import sys | ||
import sys | ||
|
||
# from unittest import TestCase | ||
from unittest import TestCase | ||
|
||
# program_path_provider = sys.modules["Rainmeter.path.program_path_provider"] | ||
program_path_provider = sys.modules["Rainmeter.path.program_path_provider"] | ||
|
||
|
||
# class TestProgramPathProvider(TestCase): | ||
class TestProgramPathProvider(TestCase): | ||
|
||
# def test_path_program_path_with_rainmeter_from_default_path(self): | ||
# """ | ||
# If the user installed the application into the default directory | ||
# it is in "C:/Program Files/Rainmeter" | ||
# """ | ||
# default_program_path = program_path_provider._get_rainmeter_path_from_default_path() | ||
def test_default_path(self): | ||
""" | ||
If the user installed the application into the default directory | ||
it is in "C:/Program Files/Rainmeter" | ||
""" | ||
default_program_path = program_path_provider._get_rainmeter_path_from_default_path() | ||
|
||
# self.assertEqual(default_program_path, "C:\\Program Files\\Rainmeter") | ||
self.assertEqual(default_program_path, "C:\\Program Files\\Rainmeter") | ||
|
||
# def test_get_rainmeter_registry_key(self): | ||
# """ | ||
# test | ||
# """ | ||
# key = program_path_provider._get_rainmeter_registry_key() | ||
def test_from_registry(self): | ||
""" | ||
Upon normal installation it will leave a registry entry to detect. | ||
We can use this to find the actual Rainmeter. | ||
Since we use the default installation path, there should no difference | ||
""" | ||
registry_program_path = program_path_provider._get_rainmeter_path_from_registry() | ||
|
||
# self.assertEqual(key, "test") | ||
self.assertEqual(registry_program_path, "C:\\Program Files\\Rainmeter") | ||
|
||
# def test_path_program_path_with_rainmeter_from_registry(self): | ||
# """ | ||
# Upon normal installation it will leave a registry entry to detect. | ||
# We can use this to find the actual Rainmeter. | ||
# Since we use the default installation path, there should no difference | ||
# """ | ||
# registry_program_path = program_path_provider._get_rainmeter_path_from_registry() | ||
def test_overall(self): | ||
""" | ||
Per default we install it onto "C:/Program Files/Rainmeter" | ||
but since we use the path internally we already add / to it | ||
and python internal path uses \\ instead windows / | ||
""" | ||
program_path = program_path_provider.get_cached_program_path() | ||
|
||
# self.assertEqual(registry_program_path, "C:\\Program Files\\Rainmeter") | ||
|
||
# def test_path_program_path_with_rainmeter_installed_return_drive(self): | ||
# """ | ||
# Per default we install it onto "C:/Program Files/Rainmeter" | ||
# """ | ||
# program_path = program_path_provider.get_cached_program_path() | ||
|
||
# self.assertEqual(program_path, "C:\\Program Files\\Rainmeter") | ||
self.assertEqual(program_path, "C:\\Program Files\\Rainmeter\\") |