<s> import mock <EOL> from cloudferry . lib . base import clients <EOL> from tests import test <EOL> class ClientsTestCase ( test . TestCase ) : <EOL> def test_skips_region_if_not_set_in_config ( self ) : <EOL> config = mock . Mock ( ) <EOL> config . region = None <EOL> config . tenant = '<STR_LIT>' <EOL> config . user = '<STR_LIT:user>' <EOL> config . password = '<STR_LIT>' <EOL> config . auth_url = '<STR_LIT>' <EOL> cmd = clients . os_cli_cmd ( config , '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertNotIn ( '<STR_LIT>' , cmd ) <EOL> def test_builds_cmd_with_all_required_creds ( self ) : <EOL> config = mock . Mock ( ) <EOL> config . region = '<STR_LIT>' <EOL> config . tenant = '<STR_LIT>' <EOL> config . user = '<STR_LIT:user>' <EOL> config . password = '<STR_LIT>' <EOL> config . auth_url = '<STR_LIT>' <EOL> client = '<STR_LIT>' <EOL> args = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> cmd = clients . os_cli_cmd ( config , client , * args ) <EOL> self . assertIn ( '<STR_LIT>' , cmd ) <EOL> self . assertIn ( '<STR_LIT>' , cmd ) <EOL> self . assertIn ( '<STR_LIT>' , cmd ) <EOL> self . assertIn ( '<STR_LIT>' , cmd ) <EOL> self . assertIn ( '<STR_LIT>' , cmd ) <EOL> self . assertTrue ( cmd . startswith ( client ) ) <EOL> self . assertTrue ( cmd . endswith ( "<STR_LIT:U+0020>" . join ( args ) ) ) </s>
