aboutsummaryrefslogtreecommitdiffstats
path: root/tests.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2018-03-12 23:13:39 +0200
committerFilipp Lepalaan <filipp@mac.com>2018-03-12 23:13:39 +0200
commitaa1142492ac7d2deeae681b7b7027479af0c89ac (patch)
tree7823230f39b8c2a5130f1816e13453abcb81b78a /tests.py
parent110bf0fa6059a5d67375ec1dd65510a82e36037f (diff)
downloadmachammer-aa1142492ac7d2deeae681b7b7027479af0c89ac.tar.gz
machammer-aa1142492ac7d2deeae681b7b7027479af0c89ac.tar.bz2
machammer-aa1142492ac7d2deeae681b7b7027479af0c89ac.zip
Pyobjc rocksHEADmaster
Diffstat (limited to 'tests.py')
-rwxr-xr-xtests.py30
1 files changed, 29 insertions, 1 deletions
diff --git a/tests.py b/tests.py
index c85ac26..c3f75e9 100755
--- a/tests.py
+++ b/tests.py
@@ -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')