<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> from salttesting import TestCase , skipIf <EOL> from salttesting . mock import ( <EOL> patch , <EOL> NO_MOCK , <EOL> NO_MOCK_REASON <EOL> ) <EOL> from salttesting . helpers import ensure_in_syspath <EOL> ensure_in_syspath ( '<STR_LIT>' ) <EOL> from salt . modules import pecl <EOL> @ skipIf ( NO_MOCK , NO_MOCK_REASON ) <EOL> class PeclTestCase ( TestCase ) : <EOL> '''<STR_LIT>''' <EOL> def test_install ( self ) : <EOL> '''<STR_LIT>''' <EOL> with patch . object ( pecl , '<STR_LIT>' , return_value = '<STR_LIT:A>' ) : <EOL> self . assertEqual ( pecl . install ( '<STR_LIT>' , force = True ) , '<STR_LIT:A>' ) <EOL> self . assertFalse ( pecl . install ( '<STR_LIT>' ) ) <EOL> with patch . object ( pecl , '<STR_LIT>' , return_value = { '<STR_LIT:A>' : [ '<STR_LIT:A>' , '<STR_LIT:B>' ] } ) : <EOL> self . assertTrue ( pecl . install ( [ '<STR_LIT:A>' , '<STR_LIT:B>' ] ) ) <EOL> def test_uninstall ( self ) : <EOL> '''<STR_LIT>''' <EOL> with patch . object ( pecl , '<STR_LIT>' , return_value = '<STR_LIT:A>' ) : <EOL> self . assertEqual ( pecl . uninstall ( '<STR_LIT>' ) , '<STR_LIT:A>' ) <EOL> def test_update ( self ) : <EOL> '''<STR_LIT>''' <EOL> with patch . object ( pecl , '<STR_LIT>' , return_value = '<STR_LIT:A>' ) : <EOL> self . assertEqual ( pecl . update ( '<STR_LIT>' ) , '<STR_LIT:A>' ) <EOL> def test_list_ ( self ) : <EOL> '''<STR_LIT>''' <EOL> with patch . object ( pecl , '<STR_LIT>' , return_value = '<STR_LIT>' ) : <EOL> self . assertDictEqual ( pecl . list_ ( '<STR_LIT>' ) , { } ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from integration import run_tests <EOL> run_tests ( PeclTestCase , needs_daemon = False ) </s>
