<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> import os <EOL> from salttesting import skipIf <EOL> from salttesting . helpers import ( <EOL> destructiveTest , <EOL> ensure_in_syspath , <EOL> requires_system_grains <EOL> ) <EOL> ensure_in_syspath ( '<STR_LIT>' ) <EOL> import integration <EOL> OSA_SCRIPT = '<STR_LIT>' <EOL> @ destructiveTest <EOL> @ skipIf ( os . geteuid ( ) != <NUM_LIT:0> , '<STR_LIT>' ) <EOL> class MacAssistiveTest ( integration . ModuleCase ) : <EOL> '''<STR_LIT>''' <EOL> def setUp ( self ) : <EOL> '''<STR_LIT>''' <EOL> os_grain = self . run_function ( '<STR_LIT>' , [ '<STR_LIT>' ] ) <EOL> if os_grain [ '<STR_LIT>' ] not in '<STR_LIT>' : <EOL> self . skipTest ( <EOL> '<STR_LIT>' . format ( <EOL> ** os_grain <EOL> ) <EOL> ) <EOL> self . run_function ( '<STR_LIT>' , [ OSA_SCRIPT , True ] ) <EOL> def tearDown ( self ) : <EOL> '''<STR_LIT>''' <EOL> osa_script = self . run_function ( '<STR_LIT>' , OSA_SCRIPT ) <EOL> if osa_script : <EOL> self . run_function ( '<STR_LIT>' , OSA_SCRIPT ) <EOL> smile_bundle = '<STR_LIT>' <EOL> smile_bundle_present = self . run_function ( '<STR_LIT>' , smile_bundle ) <EOL> if smile_bundle_present : <EOL> self . run_function ( '<STR_LIT>' , smile_bundle ) <EOL> @ requires_system_grains <EOL> def test_install_and_remove ( self , grains = None ) : <EOL> '''<STR_LIT>''' <EOL> new_bundle = '<STR_LIT>' <EOL> self . assertTrue ( <EOL> self . run_function ( '<STR_LIT>' , new_bundle ) <EOL> ) <EOL> self . assertTrue ( <EOL> self . run_function ( '<STR_LIT>' , new_bundle ) <EOL> ) <EOL> @ requires_system_grains <EOL> def test_installed ( self , grains = None ) : <EOL> '''<STR_LIT>''' <EOL> self . assertTrue ( <EOL> self . run_function ( '<STR_LIT>' , OSA_SCRIPT ) <EOL> ) <EOL> self . run_function ( '<STR_LIT>' , [ OSA_SCRIPT ] ) <EOL> self . assertFalse ( <EOL> self . run_function ( '<STR_LIT>' , [ OSA_SCRIPT ] ) <EOL> ) <EOL> @ requires_system_grains <EOL> def test_enable ( self , grains = None ) : <EOL> '''<STR_LIT>''' <EOL> self . assertTrue ( <EOL> self . run_function ( '<STR_LIT>' , [ OSA_SCRIPT , False ] ) <EOL> ) <EOL> self . assertFalse ( <EOL> self . run_function ( '<STR_LIT>' , [ OSA_SCRIPT ] ) <EOL> ) <EOL> self . assertTrue ( <EOL> self . run_function ( '<STR_LIT>' , OSA_SCRIPT ) <EOL> ) <EOL> self . assertTrue ( <EOL> self . run_function ( '<STR_LIT>' , OSA_SCRIPT ) <EOL> ) <EOL> @ requires_system_grains <EOL> def test_enabled ( self , grains = None ) : <EOL> '''<STR_LIT>''' <EOL> self . assertTrue ( <EOL> self . run_function ( '<STR_LIT>' , OSA_SCRIPT ) <EOL> ) <EOL> self . run_function ( '<STR_LIT>' , [ OSA_SCRIPT , False ] ) <EOL> self . assertFalse ( <EOL> self . run_function ( '<STR_LIT>' , [ OSA_SCRIPT ] ) <EOL> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from integration import run_tests <EOL> run_tests ( MacAssistiveTest ) </s>
