File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ # -*- coding: utf-8 -*-
2+
3+ import unittest
4+
5+ import six
6+
7+ from launchd import cmd
8+
9+
10+ class LaunchdCmdTest (unittest .TestCase ):
11+
12+ def setUp (self ):
13+ unittest .TestCase .setUp (self )
14+
15+ def tearDown (self ):
16+ unittest .TestCase .tearDown (self )
17+
18+ def testlaunchctl_invalid_args (self ):
19+ self .assertRaises (ValueError , cmd .launchctl , ['foo' ])
20+
21+ def testlaunchctl_list (self ):
22+ if six .PY2 :
23+ stdout = cmd .launchctl ("list" )
24+ else :
25+ stdout = cmd .launchctl ("list" ).decode ("utf-8" )
26+ self .assertTrue (isinstance (stdout , six .string_types ))
27+
28+ def testlaunchctl_list_x (self ):
29+ label = "com.apple.Finder"
30+ if six .PY2 :
31+ stdout = cmd .launchctl ("list" , "-x" , label )
32+ else :
33+ stdout = cmd .launchctl ("list" , "-x" , label ).decode ("utf-8" )
34+ self .assertTrue (isinstance (stdout , six .string_types ))
You can’t perform that action at this time.
0 commit comments