diff options
author | Filipp Lepalaan <filipp@mac.com> | 2018-03-12 23:13:39 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2018-03-12 23:13:39 +0200 |
commit | aa1142492ac7d2deeae681b7b7027479af0c89ac (patch) | |
tree | 7823230f39b8c2a5130f1816e13453abcb81b78a /tests.py | |
parent | 110bf0fa6059a5d67375ec1dd65510a82e36037f (diff) | |
download | machammer-master.tar.gz machammer-master.tar.bz2 machammer-master.zip |
Diffstat (limited to 'tests.py')
-rwxr-xr-x | tests.py | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -127,7 +127,7 @@ class NetworkTestCase(TestCase): self.assertTrue(network.is_wired(True)) -class AppsTestCase(TestCase): +class VersionsTestCase(TestCase): def setUp(self): self.profile = system_profiler.SystemProfile('Applications') @@ -150,6 +150,34 @@ class AppsTestCase(TestCase): self.assertLess(functions.os_version(), 10.14) +class AppsTestCase(TestCase): + + def setUp(self): + self.key = 'NSNavLastRootDirectory' + self.app = process.App('com.apple.Terminal') + + def test_get_prefs(self): + path = os.path.expanduser(self.app.prefs.get(self.key)) + self.assertTrue(os.path.exists(path)) + + def test_set_prefs(self): + self.app.prefs.set(self.key, '/tmp') + + def test_is_running(self): + self.assertTrue(self.app.is_running()) + + def test_launch(self): + self.assertTrue(self.app.launch()) + + def test_quit(self): + app = process.App('com.apple.Stickies', 'Stickies') + app.launch() + #app.quit() + + def test_is_active(self): + self.assertTrue(self.app.is_active()) + + class InstallerTestCase(TestCase): def setUp(self): self.pkg = os.getenv('MH_PKG') |