<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> from salttesting import TestCase , skipIf <EOL> from salttesting . mock import NO_MOCK , NO_MOCK_REASON <EOL> from salttesting . helpers import ensure_in_syspath <EOL> ensure_in_syspath ( '<STR_LIT>' ) <EOL> from salt . utils import http <EOL> @ skipIf ( NO_MOCK , NO_MOCK_REASON ) <EOL> class HTTPTestCase ( TestCase ) : <EOL> '''<STR_LIT>''' <EOL> def test_sanitize_url_hide_fields_none ( self ) : <EOL> '''<STR_LIT>''' <EOL> mock_url = '<STR_LIT>' <EOL> ret = http . sanitize_url ( mock_url , hide_fields = None ) <EOL> self . assertEqual ( ret , mock_url ) <EOL> def test_sanitize_url_no_elements ( self ) : <EOL> '''<STR_LIT>''' <EOL> mock_url = '<STR_LIT>' <EOL> ret = http . sanitize_url ( mock_url , [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( ret , mock_url ) <EOL> def test_sanitize_url_single_element ( self ) : <EOL> '''<STR_LIT>''' <EOL> mock_url = '<STR_LIT>' '<STR_LIT>' <EOL> mock_ret = '<STR_LIT>' '<STR_LIT>' <EOL> ret = http . sanitize_url ( mock_url , [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( ret , mock_ret ) <EOL> def test_sanitize_url_multiple_elements ( self ) : <EOL> '''<STR_LIT>''' <EOL> mock_url = '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' <EOL> mock_ret = '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' <EOL> ret = http . sanitize_url ( mock_url , [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( ret , mock_ret ) <EOL> def test_sanitize_components_no_elements ( self ) : <EOL> '''<STR_LIT>''' <EOL> mock_component_list = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> mock_ret = '<STR_LIT>' <EOL> ret = http . _sanitize_url_components ( mock_component_list , '<STR_LIT>' ) <EOL> self . assertEqual ( ret , mock_ret ) <EOL> def test_sanitize_components_one_element ( self ) : <EOL> '''<STR_LIT>''' <EOL> mock_component_list = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> mock_ret = '<STR_LIT>' <EOL> ret = http . _sanitize_url_components ( mock_component_list , '<STR_LIT>' ) <EOL> self . assertEqual ( ret , mock_ret ) <EOL> def test_sanitize_components_multiple_elements ( self ) : <EOL> '''<STR_LIT>''' <EOL> mock_component_list = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> mock_ret = '<STR_LIT>' <EOL> ret = http . _sanitize_url_components ( mock_component_list , '<STR_LIT:foo>' ) <EOL> self . assertEqual ( ret , mock_ret ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from integration import run_tests <EOL> run_tests ( HTTPTestCase , needs_daemon = False ) </s>
