diff options
author | Filipp Lepalaan <filipp@mac.com> | 2016-09-23 17:39:08 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2016-09-23 17:39:08 +0300 |
commit | 712f5bb479b7183a49feb1ee6cf279d1dbd39f6b (patch) | |
tree | a571c468d90f6937c6840e40efc75e4ca58a616b /tests.py | |
parent | 932e24d6187daea8b63baec6a19d0319f9270980 (diff) | |
download | machammer-712f5bb479b7183a49feb1ee6cf279d1dbd39f6b.tar.gz machammer-712f5bb479b7183a49feb1ee6cf279d1dbd39f6b.tar.bz2 machammer-712f5bb479b7183a49feb1ee6cf279d1dbd39f6b.zip |
Return None as path to EULA-image volumes
Diffstat (limited to 'tests.py')
-rwxr-xr-x | tests.py | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/tests.py b/tests.py deleted file mode 100755 index 6e9b28e..0000000 --- a/tests.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import logging -import subprocess -from unittest import main, skip, TestCase - -import functions as mh -import system_profiler - - -class SystemProfilerTestCase(TestCase): - def testSerialNumber(self): - sn = system_profiler.get('Hardware', 'serial_number') - self.assertTrue(len(sn) > 8) - - def testInvalidType(self): - with self.assertRaises(Exception): - system_profiler.SystemProfile('Whatever') - - def testKeys(self): - self.assertTrue(len(system_profiler.keys()) > 3) - - def testTypes(self): - self.assertIn('Hardware', system_profiler.types()) - - def testOsVersion(self): - """ - Check that the OS version we get from SP is contained - in the output of sw_vers - """ - build = subprocess.check_output(['sw_vers', '-buildVersion']).strip() - software = system_profiler.SystemProfile('Software') - self.assertIn(build, software.os_version) - - def testOsVersionShortcut(self): - build = subprocess.check_output(['sw_vers', '-buildVersion']).strip() - self.assertTrue(build in system_profiler.get('Software', 'os_version')) - - -class AppsTestCase(TestCase): - def setUp(self): - self.profile = system_profiler.SystemProfile('Applications') - - def testFindStickes(self): - results = self.profile.find('_name', 'Stickies') - self.assertTrue(len(results) > 0) - - def testStickiesVersion(self): - results = self.profile.find('_name', 'Stickies') - self.assertEquals(results[0]['version'], '10.0') - - def testFindApplications(self): - results = self.profile.find('path', '/Applications') - self.assertTrue(len(results) > 10) - - -class FunctionsTestCase(TestCase): - def setUp(self): - self.stickes = '/Applications/Stickies.app' - - def test_notification(self): - mh.display_notification('blaaa "lalala"') - - def test_add_login_item(self): - mh.add_login_item(self.stickes) - - def test_remove_login_item(self): - mh.remove_login_item(path=self.stickes) - - -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) - main() |