From 1a7754ba6dfa52f52b30fb9b80c5311fd671022b Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Thu, 27 Oct 2016 11:56:06 +0300 Subject: Added tests --- tests.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 tests.py 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() -- cgit v1.2.3