Module Expr Str ImportFrom alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias alias alias Expr Call NameLoad Str ImportFrom alias Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict FunctionDef arguments args NameParam defaults body Expr Str Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Dict Str Str Str Str Str Dict Str NameLoad Dict Str Str Str Str Dict Str Str NameLoad Dict Str Str Str Str Str Str Str NameLoad Dict Str Str Str Str Dict Str Str NameLoad Dict Str Str Str Str Str Str Str NameLoad Dict Str Str Str Str Dict Str Str NameLoad Assign NameStore Call NameLoad keyword NameLoad Assign NameStore Call NameLoad keyword NameLoad Assign NameStore Call NameLoad keyword Str With Call AttributeLoad NameLoad attr NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str keyword Num Str With Call AttributeLoad NameLoad attr NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Num With Call AttributeLoad NameLoad attr NameLoad Str NameLoad body With Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad keyword Dict Str Str With Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Call NameLoad keyword ListLoad NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad SubscriptLoad NameLoad Index Num With Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Call NameLoad keyword ListLoad NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad SubscriptLoad NameLoad Index Num With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Num With Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Num With Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Str Call NameLoad keyword ListLoad NameLoad NameLoad Call NameLoad keyword ListLoad NameLoad NameLoad Call NameLoad keyword Str Call AttributeLoad NameLoad attr NameLoad Str Call NameLoad keyword Dict Str Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Dict Str Str Str Str Dict Str Str NameLoad Dict Str Str Str Str Str Str Str NameLoad Dict Str Str Str Str Dict Str Str NameLoad Dict Str Str Str Str Str Str Str NameLoad Dict Str Str Str Str Dict Str Str NameLoad Dict Str Str Str Str Str Str Str NameLoad Assign NameStore Call NameLoad keyword Str With Call AttributeLoad NameLoad attr NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str keyword Num Str Assign NameStore Call NameLoad keyword NameLoad Assign NameStore Call NameLoad keyword NameLoad With Call AttributeLoad NameLoad attr NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Num With Call AttributeLoad NameLoad attr NameLoad Str NameLoad body Assign NameStore Call NameLoad keyword Dict Str Str With Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Str Call NameLoad keyword NameLoad Call NameLoad keyword NameLoad Call NameLoad keyword NameLoad Call AttributeLoad NameLoad attr NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad SubscriptLoad NameLoad Index Num With Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Str Call NameLoad keyword NameLoad Call NameLoad keyword NameLoad Call NameLoad keyword NameLoad Call AttributeLoad NameLoad attr NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad SubscriptLoad NameLoad Index Num With Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Call NameLoad keyword NameLoad Call NameLoad keyword NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Num With Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Str Call NameLoad keyword ListLoad NameLoad NameLoad NameLoad Call NameLoad keyword ListLoad NameLoad NameLoad NameLoad Call NameLoad keyword Str Call AttributeLoad NameLoad attr NameLoad Str Call NameLoad keyword Dict Str Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad SubscriptLoad NameLoad Index Num With Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Str Call NameLoad keyword ListLoad NameLoad NameLoad NameLoad Call NameLoad keyword ListLoad NameLoad NameLoad NameLoad Call NameLoad keyword Str Call AttributeLoad NameLoad attr NameLoad Str Call NameLoad keyword Dict body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str Str Str Str Str Str NameLoad Assign NameStore Call NameLoad keyword Dict Str Str With Call AttributeLoad NameLoad attr NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str Str Str Str Str Str NameLoad Assign NameStore Call NameLoad keyword Dict Str Str With Call AttributeLoad NameLoad attr NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Dict Str Str Str Str Dict Str Str NameLoad Dict Str Str Str Str Dict Str Str NameLoad Dict Str Str Str Str Dict Str Str NameLoad Dict Str Str Str Str Dict Str Str Str Str Str Assign NameStore Call NameLoad keyword NameLoad With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str SubscriptLoad NameLoad Index Num With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str SubscriptLoad NameLoad Index Num With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str SubscriptLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str SubscriptLoad NameLoad Index Num decorator_list decorator_list Call NameLoad NameLoad NameLoad If CompareEq NameLoad Str body ImportFrom alias Expr Call NameLoad NameLoad keyword NameLoad
N/A N/A 
    :codeauthor: :email:`Rahul Handay <rahulha@saltstack.com>`
 __future__ absolute_import N/A contextlib salttesting TestCase skipIf salttesting.helpers ensure_in_syspath salttesting.mock MagicMock patch NO_MOCK NO_MOCK_REASON N/A N/A ensure_in_syspath ../../ salt.states service N/A N/A service __salt__ N/A N/A N/A service __opts__ N/A func N/A N/A name N/A N/A N/A 
        Mock func method
     N/A name N/A ServiceTestCase N/A TestCase N/A N/A 
        Validate the service state
     test_running N/A N/A self N/A N/A N/A 
            Test to verify that the service is running
         N/A ret N/A N/A comment changes name result N/A salt True N/A changes comment name result N/A The service salt is already running salt True N/A changes comment name result saltstack The service salt is already running salt True N/A changes comment name result N/A Service salt is set to start salt None N/A changes comment name result saltstack Started Service salt salt True N/A changes comment name result N/A The service salt is already running salt True N/A tmock N/A MagicMock return_value True N/A fmock N/A MagicMock return_value False N/A vmock N/A MagicMock return_value salt N/A N/A N/A patch object service _enabled_used_error vmock N/A N/A N/A N/A self assertEqual N/A N/A service running salt enabled 1 salt N/A N/A N/A patch object service _available fmock N/A N/A N/A N/A self assertDictEqual N/A N/A service running salt N/A ret N/A 0 N/A N/A N/A patch object service _available tmock N/A N/A N/A N/A contextlib nested N/A N/A patch dict N/A service __opts__ N/A test False N/A N/A patch dict N/A service __salt__ N/A service.enabled service.status tmock tmock N/A N/A N/A N/A self assertDictEqual N/A N/A service running salt N/A ret N/A 1 N/A mock N/A MagicMock return_value N/A changes saltstack N/A N/A N/A contextlib nested N/A N/A patch dict N/A service __opts__ N/A test False N/A N/A patch dict N/A service __salt__ N/A service.enabled service.status N/A MagicMock side_effect N/A False True tmock N/A N/A patch object service _enable mock N/A N/A N/A N/A self assertDictEqual N/A N/A service running salt True N/A ret N/A 2 N/A N/A N/A contextlib nested N/A N/A patch dict N/A service __opts__ N/A test False N/A N/A patch dict N/A service __salt__ N/A service.enabled service.status N/A MagicMock side_effect N/A True False tmock N/A N/A patch object service _disable mock N/A N/A N/A N/A self assertDictEqual N/A N/A service running salt False N/A ret N/A 2 N/A N/A N/A patch dict N/A service __opts__ N/A test True N/A N/A N/A N/A self assertDictEqual N/A N/A service running salt N/A ret N/A 5 N/A N/A N/A contextlib nested N/A N/A patch dict N/A service __salt__ N/A service.status fmock N/A N/A patch dict N/A service __opts__ N/A test True N/A N/A N/A N/A self assertDictEqual N/A N/A service running salt N/A ret N/A 3 N/A N/A N/A contextlib nested N/A N/A patch dict N/A service __opts__ N/A test False N/A N/A patch dict N/A service __salt__ N/A service.status service.enabled service.start N/A MagicMock side_effect N/A False True N/A MagicMock side_effect N/A False True N/A MagicMock return_value stack N/A N/A patch object service _enable N/A MagicMock return_value N/A changes saltstack N/A N/A N/A N/A self assertDictEqual N/A N/A service running salt True N/A ret N/A 4 N/A test_dead N/A N/A self N/A N/A N/A 
            Test to ensure that the named service is dead
         N/A ret N/A N/A changes comment name result N/A salt True N/A changes comment name result saltstack The service salt is already dead salt True N/A changes comment name result N/A Service salt is set to be killed salt None N/A changes comment name result saltstack Service salt was killed salt True N/A changes comment name result N/A Service salt was killed salt True N/A changes comment name result saltstack The service salt is already dead salt True N/A mock N/A MagicMock return_value salt N/A N/A N/A patch object service _enabled_used_error mock N/A N/A N/A N/A self assertEqual N/A N/A service dead salt enabled 1 salt N/A tmock N/A MagicMock return_value True N/A fmock N/A MagicMock return_value False N/A N/A N/A patch object service _available fmock N/A N/A N/A N/A self assertDictEqual N/A N/A service dead salt N/A ret N/A 0 N/A N/A N/A patch object service _available tmock N/A N/A mock N/A MagicMock return_value N/A changes saltstack N/A N/A N/A contextlib nested N/A N/A patch dict N/A service __opts__ N/A test True N/A N/A patch dict N/A service __salt__ N/A service.enabled service.stop service.status N/A MagicMock return_value False N/A MagicMock return_value True N/A MagicMock return_value False N/A N/A patch object service _enable mock N/A N/A N/A N/A self assertDictEqual N/A N/A service dead salt True N/A ret N/A 5 N/A N/A N/A contextlib nested N/A N/A patch dict N/A service __opts__ N/A test False N/A N/A patch dict N/A service __salt__ N/A service.enabled service.stop service.status N/A MagicMock return_value False N/A MagicMock return_value True N/A MagicMock return_value False N/A N/A patch object service _enable mock N/A N/A N/A N/A self assertDictEqual N/A N/A service dead salt True N/A ret N/A 1 N/A N/A N/A contextlib nested N/A N/A patch dict N/A service __opts__ N/A test True N/A N/A patch dict N/A service __salt__ N/A service.enabled service.status N/A MagicMock return_value True N/A MagicMock return_value True N/A N/A N/A N/A self assertDictEqual N/A N/A service dead salt N/A ret N/A 2 N/A N/A N/A contextlib nested N/A N/A patch dict N/A service __opts__ N/A test False N/A N/A patch dict N/A service __salt__ N/A service.enabled service.status service.stop N/A MagicMock side_effect N/A True True False N/A MagicMock side_effect N/A True True False N/A MagicMock return_value stack N/A N/A patch object service _enable N/A MagicMock return_value N/A changes saltstack N/A N/A N/A N/A self assertDictEqual N/A N/A service dead salt True N/A ret N/A 3 N/A N/A N/A contextlib nested N/A N/A patch dict N/A service __opts__ N/A test False N/A N/A patch dict N/A service __salt__ N/A service.enabled service.status service.stop N/A MagicMock side_effect N/A False False False N/A MagicMock side_effect N/A True True True N/A MagicMock return_value stack N/A N/A patch object service _disable N/A MagicMock return_value N/A N/A N/A N/A N/A self assertDictEqual N/A N/A service dead salt False N/A ret N/A 4 N/A test_enabled N/A N/A self N/A N/A N/A 
            Test to verify that the service is enabled
         N/A ret N/A changes comment name result saltstack salt True N/A mock N/A MagicMock return_value N/A changes saltstack N/A N/A N/A patch object service _enable mock N/A N/A N/A N/A self assertDictEqual N/A N/A service enabled salt ret N/A test_disabled N/A N/A self N/A N/A N/A 
            Test to verify that the service is disabled
         N/A ret N/A changes comment name result saltstack salt True N/A mock N/A MagicMock return_value N/A changes saltstack N/A N/A N/A patch object service _disable mock N/A N/A N/A N/A self assertDictEqual N/A N/A service disabled salt ret N/A test_mod_watch N/A N/A self N/A N/A N/A 
            Test to the service watcher, called to invoke the watch command.
         N/A ret N/A N/A changes comment name result N/A Service is already stopped salt True N/A changes comment name result N/A Unable to trigger watch for service.stack salt False N/A changes comment name result N/A Service is set to be started salt None N/A changes comment name result N/A salt salt Service started salt salt N/A mock N/A MagicMock return_value False N/A N/A N/A patch dict N/A service __salt__ N/A service.status mock N/A N/A N/A N/A self assertDictEqual N/A N/A service mod_watch salt dead N/A ret N/A 0 N/A N/A N/A patch dict N/A service __salt__ N/A service.start func N/A N/A N/A N/A patch dict N/A service __opts__ N/A test True N/A N/A N/A N/A self assertDictEqual N/A N/A service mod_watch salt running N/A ret N/A 2 N/A N/A N/A patch dict N/A service __opts__ N/A test False N/A N/A N/A N/A self assertDictEqual N/A N/A service mod_watch salt running N/A ret N/A 3 N/A N/A N/A self assertDictEqual N/A N/A service mod_watch salt stack N/A ret N/A 1 N/A N/A N/A skipIf NO_MOCK NO_MOCK_REASON N/A N/A __name__ __main__ N/A integration run_tests N/A N/A run_tests ServiceTestCase needs_daemon False