<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> from salt . cloud . clouds import gce <EOL> from salt . exceptions import SaltCloudSystemExit <EOL> from salttesting import TestCase , skipIf <EOL> from salttesting . mock import MagicMock , NO_MOCK , NO_MOCK_REASON , patch <EOL> from salttesting . helpers import ensure_in_syspath <EOL> ensure_in_syspath ( '<STR_LIT>' ) <EOL> gce . __active_provider_name__ = '<STR_LIT>' <EOL> gce . __opts__ = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> } <EOL> } <EOL> } <EOL> VM_NAME = '<STR_LIT>' <EOL> DUMMY_TOKEN = { <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> class ExtendedTestCase ( TestCase ) : <EOL> '''<STR_LIT>''' <EOL> def assertRaisesWithMessage ( self , exc_type , exc_msg , func , * args , ** kwargs ) : <EOL> try : <EOL> func ( * args , ** kwargs ) <EOL> self . assertFail ( ) <EOL> except Exception as exc : <EOL> self . assertEqual ( type ( exc ) , exc_type ) <EOL> self . assertEqual ( exc . message , exc_msg ) <EOL> @ skipIf ( NO_MOCK , NO_MOCK_REASON ) <EOL> @ patch ( '<STR_LIT>' , MagicMock ( return_value = '<STR_LIT>' ) ) <EOL> @ patch ( '<STR_LIT>' , MagicMock ( return_value = DUMMY_TOKEN ) ) <EOL> @ patch ( '<STR_LIT>' , MagicMock ( return_value = [ ] ) ) <EOL> @ patch ( '<STR_LIT>' , MagicMock ( return_value = [ ] ) ) <EOL> class GCETestCase ( ExtendedTestCase ) : <EOL> '''<STR_LIT>''' <EOL> def test_destroy_call ( self ) : <EOL> '''<STR_LIT>''' <EOL> self . assertRaises ( <EOL> SaltCloudSystemExit , <EOL> gce . destroy , <EOL> vm_name = VM_NAME , <EOL> call = '<STR_LIT>' <EOL> ) <EOL> @ patch ( '<STR_LIT>' , MagicMock ( return_value = [ ] ) ) <EOL> def test_avail_sizes ( self ) : <EOL> '''<STR_LIT>''' <EOL> sizes = gce . avail_sizes ( ) <EOL> self . assertEqual ( <EOL> sizes , <EOL> [ ] <EOL> ) <EOL> @ patch ( '<STR_LIT>' , MagicMock ( return_value = [ ] ) ) <EOL> def test_list_nodes ( self ) : <EOL> nodes = gce . list_nodes ( ) <EOL> self . assertEqual ( <EOL> nodes , <EOL> { } <EOL> ) <EOL> @ patch ( '<STR_LIT>' , MagicMock ( return_value = [ ] ) ) <EOL> def test_list_locations ( self ) : <EOL> locations = gce . avail_locations ( ) <EOL> self . assertEqual ( <EOL> locations , <EOL> { } <EOL> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from integration import run_tests <EOL> run_tests ( GCETestCase , needs_daemon = False ) </s>
