#NEWLINE# @ mock . patch ( 'cloudbaseinit.plugins.common.userdataplugins.cloudconfigplugins.set_timezone.factory' ) #NEWLINE# def test_process( self , mock_osutils_factory ) : #NEWLINE# #INDENT# with testutils . LogSnatcher ( 'cloudbaseinit.plugins.common.userdataplugins.cloudconfigplugins.set_timezone' ) as snatcher : #NEWLINE# #INDENT# set_timezone . SetTimezonePlugin ( ) . process ( mock . sentinel . timezone ) #NEWLINE# #UNINDENT# expected_logging = [ ( 'Changing timezone to %r' % mock . sentinel . timezone ) ] #NEWLINE# mock_osutils_factory . get_os_utils . assert_called_once_with ( ) #NEWLINE# mock_osutils = mock_osutils_factory . get_os_utils . return_value #NEWLINE# mock_osutils . set_timezone . assert_called_once_with ( mock . sentinel . timezone ) #NEWLINE# self . assertEqual ( expected_logging , mock_osutils_factory . output )