aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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()