1. Ronald Oussoren
  2. pyobjc

Source

pyobjc / pyobjc-framework-ServiceManagement / PyObjCTest / test_smerrors.py


from PyObjCTools.TestSupport import *
from ServiceManagement import *

try:
    unicode
except NameError:
    unicode = str

class TestSMErrors (TestCase):
    @min_os_level('10.6')
    def testConstants(self):
        self.assertIsInstance(kSMErrorDomainIPC, unicode)
        self.assertIsInstance(kSMErrorDomainFramework, unicode)
        self.assertIsInstance(kSMErrorDomainLaunchd, unicode)

        self.assertEqual(kSMErrorInternalFailure, 2)
        self.assertEqual(kSMErrorInvalidSignature, 3)
        self.assertEqual(kSMErrorAuthorizationFailure, 4)
        self.assertEqual(kSMErrorToolNotValid, 5)
        self.assertEqual(kSMErrorJobNotFound, 6)
        self.assertEqual(kSMErrorServiceUnavailable, 7)
        self.assertEqual(kSMErrorJobPlistNotFound, 8)
        self.assertEqual(kSMErrorJobMustBeEnabled, 9)

if __name__ == "__main__":
    main()