<s> from oslo_utils import fixture as utils_fixture <EOL> from nova . tests . functional . notification_sample_tests import notification_sample_base <EOL> from nova . tests . unit . api . openstack . compute import test_services <EOL> class TestServiceUpdateNotificationSample ( <EOL> notification_sample_base . NotificationSampleTestBase ) : <EOL> def setUp ( self ) : <EOL> super ( TestServiceUpdateNotificationSample , self ) . setUp ( ) <EOL> self . stub_out ( "<STR_LIT>" , <EOL> test_services . fake_service_get_by_host_binary ) <EOL> self . stub_out ( "<STR_LIT>" , <EOL> test_services . fake_service_update ) <EOL> self . useFixture ( utils_fixture . TimeFixture ( test_services . fake_utcnow ( ) ) ) <EOL> def test_service_enable ( self ) : <EOL> body = { '<STR_LIT:host>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> self . admin_api . api_put ( '<STR_LIT>' , body ) <EOL> self . _verify_notification ( '<STR_LIT>' ) <EOL> def test_service_disabled ( self ) : <EOL> body = { '<STR_LIT:host>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> self . admin_api . api_put ( '<STR_LIT>' , body ) <EOL> self . _verify_notification ( '<STR_LIT>' , <EOL> replacements = { '<STR_LIT>' : True } ) <EOL> def test_service_disabled_log_reason ( self ) : <EOL> body = { '<STR_LIT:host>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> self . admin_api . api_put ( '<STR_LIT>' , body ) <EOL> self . _verify_notification ( '<STR_LIT>' , <EOL> replacements = { '<STR_LIT>' : True , <EOL> '<STR_LIT>' : '<STR_LIT>' } ) <EOL> def test_service_force_down ( self ) : <EOL> body = { '<STR_LIT:host>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : True } <EOL> self . admin_api . microversion = '<STR_LIT>' <EOL> self . admin_api . api_put ( '<STR_LIT>' , body ) <EOL> self . _verify_notification ( '<STR_LIT>' , <EOL> replacements = { '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : '<STR_LIT>' } ) </s>
