aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2016-10-27 11:56:06 +0300
committerFilipp Lepalaan <filipp@mac.com>2016-10-27 11:56:06 +0300
commit1a7754ba6dfa52f52b30fb9b80c5311fd671022b (patch)
tree8362c8fb7dd1804838e97f2393dbd571ce3cf8d6
parent634bdd672e46e6e9d6428f3fa1d06695995c78c9 (diff)
downloadmaucl-1a7754ba6dfa52f52b30fb9b80c5311fd671022b.tar.gz
maucl-1a7754ba6dfa52f52b30fb9b80c5311fd671022b.tar.bz2
maucl-1a7754ba6dfa52f52b30fb9b80c5311fd671022b.zip
Added tests
-rwxr-xr-xtests.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests.py b/tests.py
new file mode 100755
index 0000000..b67a966
--- /dev/null
+++ b/tests.py
@@ -0,0 +1,29 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import unittest
+import subprocess
+
+import mowgli
+
+
+class DefaultTestCase(unittest.TestCase):
+ def test_disable_au(self):
+ mowgli.set_pref()
+ o = subprocess.check_output(['defaults',
+ 'read',
+ 'com.microsoft.autoupdate2',
+ 'HowToCheck'])
+ self.assertEquals(o.strip(), 'Manual')
+
+ def test_enable_au(self):
+ mowgli.set_pref(v='Automatic')
+ o = subprocess.check_output(['defaults',
+ 'read',
+ 'com.microsoft.autoupdate2',
+ 'HowToCheck'])
+ self.assertEquals(o.strip(), 'Automatic')
+
+
+if __name__ == '__main__':
+ unittest.main()