<gh_stars>0
begin_unit
comment|'# Copyright 2012 IBM Corp.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'#    Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'#    not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'#    a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'#         http://www.apache.org/licenses/LICENSE-2.0'
nl|'\n'
comment|'#'
nl|'\n'
comment|'#    Unless required by applicable law or agreed to in writing, software'
nl|'\n'
comment|'#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
nl|'\n'
comment|'#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
nl|'\n'
comment|'#    License for the specific language governing permissions and limitations'
nl|'\n'
comment|'#    under the License.'
nl|'\n'
nl|'\n'
nl|'\n'
name|'import'
name|'copy'
newline|'\n'
name|'import'
name|'datetime'
newline|'\n'
nl|'\n'
name|'import'
name|'iso8601'
newline|'\n'
name|'import'
name|'mock'
newline|'\n'
name|'from'
name|'oslo_utils'
name|'import'
name|'fixture'
name|'as'
name|'utils_fixture'
newline|'\n'
name|'import'
name|'webob'
op|'.'
name|'exc'
newline|'\n'
nl|'\n'
name|'from'
name|'nova'
op|'.'
name|'api'
op|'.'
name|'openstack'
name|'import'
name|'api_version_request'
name|'as'
name|'api_version'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'api'
op|'.'
name|'openstack'
op|'.'
name|'compute'
name|'import'
name|'services'
name|'as'
name|'services_v21'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'api'
op|'.'
name|'openstack'
name|'import'
name|'extensions'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'api'
op|'.'
name|'openstack'
name|'import'
name|'wsgi'
name|'as'
name|'os_wsgi'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'availability_zones'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'cells'
name|'import'
name|'utils'
name|'as'
name|'cells_utils'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'compute'
name|'import'
name|'cells_api'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'context'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'exception'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'objects'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'servicegroup'
op|'.'
name|'drivers'
name|'import'
name|'db'
name|'as'
name|'db_driver'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'test'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
op|'.'
name|'api'
op|'.'
name|'openstack'
name|'import'
name|'fakes'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
op|'.'
name|'objects'
name|'import'
name|'test_service'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|variable|fake_services_list
name|'fake_services_list'
op|'='
op|'['
nl|'\n'
name|'dict'
op|'('
name|'test_service'
op|'.'
name|'fake_service'
op|','
nl|'\n'
DECL|variable|binary
name|'binary'
op|'='
string|"'nova-scheduler'"
op|','
nl|'\n'
DECL|variable|host
name|'host'
op|'='
string|"'host1'"
op|','
nl|'\n'
DECL|variable|id
name|'id'
op|'='
number|'1'
op|','
nl|'\n'
DECL|variable|disabled
name|'disabled'
op|'='
name|'True'
op|','
nl|'\n'
DECL|variable|topic
name|'topic'
op|'='
string|"'scheduler'"
op|','
nl|'\n'
DECL|variable|updated_at
name|'updated_at'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|')'
op|','
nl|'\n'
DECL|variable|created_at
name|'created_at'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'2'
op|','
number|'46'
op|','
number|'27'
op|')'
op|','
nl|'\n'
DECL|variable|last_seen_up
name|'last_seen_up'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|')'
op|','
nl|'\n'
DECL|variable|forced_down
name|'forced_down'
op|'='
name|'False'
op|','
nl|'\n'
DECL|variable|disabled_reason
name|'disabled_reason'
op|'='
string|"'test1'"
op|')'
op|','
nl|'\n'
name|'dict'
op|'('
name|'test_service'
op|'.'
name|'fake_service'
op|','
nl|'\n'
DECL|variable|binary
name|'binary'
op|'='
string|"'nova-compute'"
op|','
nl|'\n'
DECL|variable|host
name|'host'
op|'='
string|"'host1'"
op|','
nl|'\n'
DECL|variable|id
name|'id'
op|'='
number|'2'
op|','
nl|'\n'
DECL|variable|disabled
name|'disabled'
op|'='
name|'True'
op|','
nl|'\n'
DECL|variable|topic
name|'topic'
op|'='
string|"'compute'"
op|','
nl|'\n'
DECL|variable|updated_at
name|'updated_at'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|','
nl|'\n'
DECL|variable|created_at
name|'created_at'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'2'
op|','
number|'46'
op|','
number|'27'
op|')'
op|','
nl|'\n'
DECL|variable|last_seen_up
name|'last_seen_up'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|','
nl|'\n'
DECL|variable|forced_down
name|'forced_down'
op|'='
name|'False'
op|','
nl|'\n'
DECL|variable|disabled_reason
name|'disabled_reason'
op|'='
string|"'test2'"
op|')'
op|','
nl|'\n'
name|'dict'
op|'('
name|'test_service'
op|'.'
name|'fake_service'
op|','
nl|'\n'
DECL|variable|binary
name|'binary'
op|'='
string|"'nova-scheduler'"
op|','
nl|'\n'
DECL|variable|host
name|'host'
op|'='
string|"'host2'"
op|','
nl|'\n'
DECL|variable|id
name|'id'
op|'='
number|'3'
op|','
nl|'\n'
DECL|variable|disabled
name|'disabled'
op|'='
name|'False'
op|','
nl|'\n'
DECL|variable|topic
name|'topic'
op|'='
string|"'scheduler'"
op|','
nl|'\n'
DECL|variable|updated_at
name|'updated_at'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'19'
op|','
number|'6'
op|','
number|'55'
op|','
number|'34'
op|')'
op|','
nl|'\n'
DECL|variable|created_at
name|'created_at'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'2'
op|','
number|'46'
op|','
number|'28'
op|')'
op|','
nl|'\n'
DECL|variable|last_seen_up
name|'last_seen_up'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'19'
op|','
number|'6'
op|','
number|'55'
op|','
number|'34'
op|')'
op|','
nl|'\n'
DECL|variable|forced_down
name|'forced_down'
op|'='
name|'False'
op|','
nl|'\n'
DECL|variable|disabled_reason
name|'disabled_reason'
op|'='
name|'None'
op|')'
op|','
nl|'\n'
name|'dict'
op|'('
name|'test_service'
op|'.'
name|'fake_service'
op|','
nl|'\n'
DECL|variable|binary
name|'binary'
op|'='
string|"'nova-compute'"
op|','
nl|'\n'
DECL|variable|host
name|'host'
op|'='
string|"'host2'"
op|','
nl|'\n'
DECL|variable|id
name|'id'
op|'='
number|'4'
op|','
nl|'\n'
DECL|variable|disabled
name|'disabled'
op|'='
name|'True'
op|','
nl|'\n'
DECL|variable|topic
name|'topic'
op|'='
string|"'compute'"
op|','
nl|'\n'
DECL|variable|updated_at
name|'updated_at'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|')'
op|','
nl|'\n'
DECL|variable|created_at
name|'created_at'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'2'
op|','
number|'46'
op|','
number|'28'
op|')'
op|','
nl|'\n'
DECL|variable|last_seen_up
name|'last_seen_up'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|')'
op|','
nl|'\n'
DECL|variable|forced_down
name|'forced_down'
op|'='
name|'False'
op|','
nl|'\n'
DECL|variable|disabled_reason
name|'disabled_reason'
op|'='
string|"'test4'"
op|')'
op|','
nl|'\n'
comment|'# NOTE(rpodolyaka): API services are special case and must be filtered out'
nl|'\n'
name|'dict'
op|'('
name|'test_service'
op|'.'
name|'fake_service'
op|','
nl|'\n'
DECL|variable|binary
name|'binary'
op|'='
string|"'nova-osapi_compute'"
op|','
nl|'\n'
DECL|variable|host
name|'host'
op|'='
string|"'host2'"
op|','
nl|'\n'
DECL|variable|id
name|'id'
op|'='
number|'5'
op|','
nl|'\n'
DECL|variable|disabled
name|'disabled'
op|'='
name|'False'
op|','
nl|'\n'
DECL|variable|topic
name|'topic'
op|'='
name|'None'
op|','
nl|'\n'
DECL|variable|updated_at
name|'updated_at'
op|'='
name|'None'
op|','
nl|'\n'
DECL|variable|created_at
name|'created_at'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'2'
op|','
number|'46'
op|','
number|'28'
op|')'
op|','
nl|'\n'
DECL|variable|last_seen_up
name|'last_seen_up'
op|'='
name|'None'
op|','
nl|'\n'
DECL|variable|forced_down
name|'forced_down'
op|'='
name|'False'
op|','
nl|'\n'
DECL|variable|disabled_reason
name|'disabled_reason'
op|'='
name|'None'
op|')'
op|','
nl|'\n'
name|'dict'
op|'('
name|'test_service'
op|'.'
name|'fake_service'
op|','
nl|'\n'
DECL|variable|binary
name|'binary'
op|'='
string|"'nova-metadata'"
op|','
nl|'\n'
DECL|variable|host
name|'host'
op|'='
string|"'host2'"
op|','
nl|'\n'
DECL|variable|id
name|'id'
op|'='
number|'6'
op|','
nl|'\n'
DECL|variable|disabled
name|'disabled'
op|'='
name|'False'
op|','
nl|'\n'
DECL|variable|topic
name|'topic'
op|'='
name|'None'
op|','
nl|'\n'
DECL|variable|updated_at
name|'updated_at'
op|'='
name|'None'
op|','
nl|'\n'
DECL|variable|created_at
name|'created_at'
op|'='
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'2'
op|','
number|'46'
op|','
number|'28'
op|')'
op|','
nl|'\n'
DECL|variable|last_seen_up
name|'last_seen_up'
op|'='
name|'None'
op|','
nl|'\n'
DECL|variable|forced_down
name|'forced_down'
op|'='
name|'False'
op|','
nl|'\n'
DECL|variable|disabled_reason
name|'disabled_reason'
op|'='
name|'None'
op|')'
op|','
nl|'\n'
op|']'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|FakeRequest
name|'class'
name|'FakeRequest'
op|'('
name|'object'
op|')'
op|':'
newline|'\n'
DECL|variable|environ
indent|'    '
name|'environ'
op|'='
op|'{'
string|'"nova.context"'
op|':'
name|'context'
op|'.'
name|'get_admin_context'
op|'('
op|')'
op|'}'
newline|'\n'
DECL|variable|GET
name|'GET'
op|'='
op|'{'
op|'}'
newline|'\n'
nl|'\n'
DECL|member|__init__
name|'def'
name|'__init__'
op|'('
name|'self'
op|','
name|'version'
op|'='
name|'os_wsgi'
op|'.'
name|'DEFAULT_API_VERSION'
op|')'
op|':'
comment|"# version='2.1'):"
newline|'\n'
indent|'        '
name|'super'
op|'('
name|'FakeRequest'
op|','
name|'self'
op|')'
op|'.'
name|'__init__'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'api_version_request'
op|'='
name|'api_version'
op|'.'
name|'APIVersionRequest'
op|'('
name|'version'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|FakeRequestWithService
dedent|''
dedent|''
name|'class'
name|'FakeRequestWithService'
op|'('
name|'FakeRequest'
op|')'
op|':'
newline|'\n'
DECL|variable|GET
indent|'    '
name|'GET'
op|'='
op|'{'
string|'"binary"'
op|':'
string|'"nova-compute"'
op|'}'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|FakeRequestWithHost
dedent|''
name|'class'
name|'FakeRequestWithHost'
op|'('
name|'FakeRequest'
op|')'
op|':'
newline|'\n'
DECL|variable|GET
indent|'    '
name|'GET'
op|'='
op|'{'
string|'"host"'
op|':'
string|'"host1"'
op|'}'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|FakeRequestWithHostService
dedent|''
name|'class'
name|'FakeRequestWithHostService'
op|'('
name|'FakeRequest'
op|')'
op|':'
newline|'\n'
DECL|variable|GET
indent|'    '
name|'GET'
op|'='
op|'{'
string|'"host"'
op|':'
string|'"host1"'
op|','
string|'"binary"'
op|':'
string|'"nova-compute"'
op|'}'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|fake_service_get_all
dedent|''
name|'def'
name|'fake_service_get_all'
op|'('
name|'services'
op|')'
op|':'
newline|'\n'
DECL|function|service_get_all
indent|'    '
name|'def'
name|'service_get_all'
op|'('
name|'context'
op|','
name|'filters'
op|'='
name|'None'
op|','
name|'set_zones'
op|'='
name|'False'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'if'
name|'set_zones'
name|'or'
string|"'availability_zone'"
name|'in'
name|'filters'
op|':'
newline|'\n'
indent|'            '
name|'return'
name|'availability_zones'
op|'.'
name|'set_availability_zones'
op|'('
name|'context'
op|','
nl|'\n'
name|'services'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'services'
newline|'\n'
dedent|''
name|'return'
name|'service_get_all'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|fake_db_api_service_get_all
dedent|''
name|'def'
name|'fake_db_api_service_get_all'
op|'('
name|'context'
op|','
name|'disabled'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|'    '
name|'return'
name|'fake_services_list'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|fake_db_service_get_by_host_binary
dedent|''
name|'def'
name|'fake_db_service_get_by_host_binary'
op|'('
name|'services'
op|')'
op|':'
newline|'\n'
DECL|function|service_get_by_host_binary
indent|'    '
name|'def'
name|'service_get_by_host_binary'
op|'('
name|'context'
op|','
name|'host'
op|','
name|'binary'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'for'
name|'service'
name|'in'
name|'services'
op|':'
newline|'\n'
indent|'            '
name|'if'
name|'service'
op|'['
string|"'host'"
op|']'
op|'=='
name|'host'
name|'and'
name|'service'
op|'['
string|"'binary'"
op|']'
op|'=='
name|'binary'
op|':'
newline|'\n'
indent|'                '
name|'return'
name|'service'
newline|'\n'
dedent|''
dedent|''
name|'raise'
name|'exception'
op|'.'
name|'HostBinaryNotFound'
op|'('
name|'host'
op|'='
name|'host'
op|','
name|'binary'
op|'='
name|'binary'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'service_get_by_host_binary'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|fake_service_get_by_host_binary
dedent|''
name|'def'
name|'fake_service_get_by_host_binary'
op|'('
name|'context'
op|','
name|'host'
op|','
name|'binary'
op|')'
op|':'
newline|'\n'
indent|'    '
name|'fake'
op|'='
name|'fake_db_service_get_by_host_binary'
op|'('
name|'fake_services_list'
op|')'
newline|'\n'
name|'return'
name|'fake'
op|'('
name|'context'
op|','
name|'host'
op|','
name|'binary'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_service_get_by_id
dedent|''
name|'def'
name|'_service_get_by_id'
op|'('
name|'services'
op|','
name|'value'
op|')'
op|':'
newline|'\n'
indent|'    '
name|'for'
name|'service'
name|'in'
name|'services'
op|':'
newline|'\n'
indent|'        '
name|'if'
name|'service'
op|'['
string|"'id'"
op|']'
op|'=='
name|'value'
op|':'
newline|'\n'
indent|'            '
name|'return'
name|'service'
newline|'\n'
dedent|''
dedent|''
name|'return'
name|'None'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|fake_db_service_update
dedent|''
name|'def'
name|'fake_db_service_update'
op|'('
name|'services'
op|')'
op|':'
newline|'\n'
DECL|function|service_update
indent|'    '
name|'def'
name|'service_update'
op|'('
name|'context'
op|','
name|'service_id'
op|','
name|'values'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'service'
op|'='
name|'_service_get_by_id'
op|'('
name|'services'
op|','
name|'service_id'
op|')'
newline|'\n'
name|'if'
name|'service'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|'            '
name|'raise'
name|'exception'
op|'.'
name|'ServiceNotFound'
op|'('
name|'service_id'
op|'='
name|'service_id'
op|')'
newline|'\n'
dedent|''
name|'service'
op|'='
name|'copy'
op|'.'
name|'deepcopy'
op|'('
name|'service'
op|')'
newline|'\n'
name|'service'
op|'.'
name|'update'
op|'('
name|'values'
op|')'
newline|'\n'
name|'return'
name|'service'
newline|'\n'
dedent|''
name|'return'
name|'service_update'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|fake_service_update
dedent|''
name|'def'
name|'fake_service_update'
op|'('
name|'context'
op|','
name|'service_id'
op|','
name|'values'
op|')'
op|':'
newline|'\n'
indent|'    '
name|'fake'
op|'='
name|'fake_db_service_update'
op|'('
name|'fake_services_list'
op|')'
newline|'\n'
name|'return'
name|'fake'
op|'('
name|'context'
op|','
name|'service_id'
op|','
name|'values'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|fake_utcnow
dedent|''
name|'def'
name|'fake_utcnow'
op|'('
op|')'
op|':'
newline|'\n'
indent|'    '
name|'return'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'11'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|ServicesTestV21
dedent|''
name|'class'
name|'ServicesTestV21'
op|'('
name|'test'
op|'.'
name|'TestCase'
op|')'
op|':'
newline|'\n'
DECL|variable|service_is_up_exc
indent|'    '
name|'service_is_up_exc'
op|'='
name|'webob'
op|'.'
name|'exc'
op|'.'
name|'HTTPInternalServerError'
newline|'\n'
DECL|variable|bad_request
name|'bad_request'
op|'='
name|'exception'
op|'.'
name|'ValidationError'
newline|'\n'
DECL|variable|wsgi_api_version
name|'wsgi_api_version'
op|'='
name|'os_wsgi'
op|'.'
name|'DEFAULT_API_VERSION'
newline|'\n'
nl|'\n'
DECL|member|_set_up_controller
name|'def'
name|'_set_up_controller'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'controller'
op|'='
name|'services_v21'
op|'.'
name|'ServiceController'
op|'('
op|')'
newline|'\n'
nl|'\n'
DECL|member|setUp
dedent|''
name|'def'
name|'setUp'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'super'
op|'('
name|'ServicesTestV21'
op|','
name|'self'
op|')'
op|'.'
name|'setUp'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'ext_mgr'
op|'='
name|'extensions'
op|'.'
name|'ExtensionManager'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'='
op|'{'
op|'}'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'_set_up_controller'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'host_api'
op|'.'
name|'service_get_all'
op|'='
op|'('
nl|'\n'
name|'mock'
op|'.'
name|'Mock'
op|'('
name|'side_effect'
op|'='
name|'fake_service_get_all'
op|'('
name|'fake_services_list'
op|')'
op|')'
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'useFixture'
op|'('
name|'utils_fixture'
op|'.'
name|'TimeFixture'
op|'('
name|'fake_utcnow'
op|'('
op|')'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'stub_out'
op|'('
string|"'nova.db.service_get_by_host_and_binary'"
op|','
nl|'\n'
name|'fake_db_service_get_by_host_binary'
op|'('
name|'fake_services_list'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'stub_out'
op|'('
string|"'nova.db.service_update'"
op|','
nl|'\n'
name|'fake_db_service_update'
op|'('
name|'fake_services_list'
op|')'
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'req'
op|'='
name|'fakes'
op|'.'
name|'HTTPRequest'
op|'.'
name|'blank'
op|'('
string|"''"
op|')'
newline|'\n'
nl|'\n'
DECL|member|_process_output
dedent|''
name|'def'
name|'_process_output'
op|'('
name|'self'
op|','
name|'services'
op|','
name|'has_disabled'
op|'='
name|'False'
op|','
name|'has_id'
op|'='
name|'False'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'return'
name|'services'
newline|'\n'
nl|'\n'
DECL|member|test_services_list
dedent|''
name|'def'
name|'test_services_list'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'req'
op|'='
name|'FakeRequest'
op|'('
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test1'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'3'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'enabled'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'19'
op|','
number|'6'
op|','
number|'55'
op|','
number|'34'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'4'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test4'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|')'
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_list_with_host
dedent|''
name|'def'
name|'test_services_list_with_host'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'req'
op|'='
name|'FakeRequestWithHost'
op|'('
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test1'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_list_with_service
dedent|''
name|'def'
name|'test_services_list_with_service'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'req'
op|'='
name|'FakeRequestWithService'
op|'('
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test4'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'4'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|')'
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_list_with_host_service
dedent|''
name|'def'
name|'test_services_list_with_host_service'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'req'
op|'='
name|'FakeRequestWithHostService'
op|'('
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_detail
dedent|''
name|'def'
name|'test_services_detail'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'req'
op|'='
name|'FakeRequest'
op|'('
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test1'"
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'enabled'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'3'
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'19'
op|','
number|'6'
op|','
number|'55'
op|','
number|'34'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
name|'None'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'4'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test4'"
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|','
name|'has_disabled'
op|'='
name|'True'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_service_detail_with_host
dedent|''
name|'def'
name|'test_service_detail_with_host'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'req'
op|'='
name|'FakeRequestWithHost'
op|'('
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test1'"
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|','
name|'has_disabled'
op|'='
name|'True'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_service_detail_with_service
dedent|''
name|'def'
name|'test_service_detail_with_service'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'req'
op|'='
name|'FakeRequestWithService'
op|'('
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'4'
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test4'"
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|','
name|'has_disabled'
op|'='
name|'True'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_service_detail_with_host_service
dedent|''
name|'def'
name|'test_service_detail_with_host_service'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'req'
op|'='
name|'FakeRequestWithHostService'
op|'('
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|','
name|'has_disabled'
op|'='
name|'True'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_detail_with_delete_extension
dedent|''
name|'def'
name|'test_services_detail_with_delete_extension'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services-delete'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'req'
op|'='
name|'FakeRequest'
op|'('
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test1'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'id'"
op|':'
number|'3'
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'enabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'19'
op|','
number|'6'
op|','
number|'55'
op|','
number|'34'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'4'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test4'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|')'
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|','
name|'has_id'
op|'='
name|'True'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_enable
dedent|''
name|'def'
name|'test_services_enable'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
DECL|function|_service_update
indent|'        '
name|'def'
name|'_service_update'
op|'('
name|'context'
op|','
name|'service_id'
op|','
name|'values'
op|')'
op|':'
newline|'\n'
indent|'            '
name|'self'
op|'.'
name|'assertIsNone'
op|'('
name|'values'
op|'['
string|"'disabled_reason'"
op|']'
op|')'
newline|'\n'
name|'return'
name|'dict'
op|'('
name|'test_service'
op|'.'
name|'fake_service'
op|','
name|'id'
op|'='
name|'service_id'
op|','
op|'**'
name|'values'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'self'
op|'.'
name|'stub_out'
op|'('
string|"'nova.db.service_update'"
op|','
name|'_service_update'
op|')'
newline|'\n'
nl|'\n'
name|'body'
op|'='
op|'{'
string|"'host'"
op|':'
string|"'host1'"
op|','
string|"'binary'"
op|':'
string|"'nova-compute'"
op|'}'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'update'
op|'('
name|'self'
op|'.'
name|'req'
op|','
string|'"enable"'
op|','
name|'body'
op|'='
name|'body'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|'['
string|"'service'"
op|']'
op|'['
string|"'status'"
op|']'
op|','
string|"'enabled'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertNotIn'
op|'('
string|"'disabled_reason'"
op|','
name|'res_dict'
op|'['
string|"'service'"
op|']'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_enable_with_invalid_host
dedent|''
name|'def'
name|'test_services_enable_with_invalid_host'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'body'
op|'='
op|'{'
string|"'host'"
op|':'
string|"'invalid'"
op|','
string|"'binary'"
op|':'
string|"'nova-compute'"
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'webob'
op|'.'
name|'exc'
op|'.'
name|'HTTPNotFound'
op|','
nl|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'update'
op|','
nl|'\n'
name|'self'
op|'.'
name|'req'
op|','
nl|'\n'
string|'"enable"'
op|','
nl|'\n'
name|'body'
op|'='
name|'body'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_enable_with_invalid_binary
dedent|''
name|'def'
name|'test_services_enable_with_invalid_binary'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'body'
op|'='
op|'{'
string|"'host'"
op|':'
string|"'host1'"
op|','
string|"'binary'"
op|':'
string|"'invalid'"
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'webob'
op|'.'
name|'exc'
op|'.'
name|'HTTPNotFound'
op|','
nl|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'update'
op|','
nl|'\n'
name|'self'
op|'.'
name|'req'
op|','
nl|'\n'
string|'"enable"'
op|','
nl|'\n'
name|'body'
op|'='
name|'body'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_disable
dedent|''
name|'def'
name|'test_services_disable'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'body'
op|'='
op|'{'
string|"'host'"
op|':'
string|"'host1'"
op|','
string|"'binary'"
op|':'
string|"'nova-compute'"
op|'}'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'update'
op|'('
name|'self'
op|'.'
name|'req'
op|','
string|'"disable"'
op|','
name|'body'
op|'='
name|'body'
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|'['
string|"'service'"
op|']'
op|'['
string|"'status'"
op|']'
op|','
string|"'disabled'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertNotIn'
op|'('
string|"'disabled_reason'"
op|','
name|'res_dict'
op|'['
string|"'service'"
op|']'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_disable_with_invalid_host
dedent|''
name|'def'
name|'test_services_disable_with_invalid_host'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'body'
op|'='
op|'{'
string|"'host'"
op|':'
string|"'invalid'"
op|','
string|"'binary'"
op|':'
string|"'nova-compute'"
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'webob'
op|'.'
name|'exc'
op|'.'
name|'HTTPNotFound'
op|','
nl|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'update'
op|','
nl|'\n'
name|'self'
op|'.'
name|'req'
op|','
nl|'\n'
string|'"disable"'
op|','
nl|'\n'
name|'body'
op|'='
name|'body'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_disable_with_invalid_binary
dedent|''
name|'def'
name|'test_services_disable_with_invalid_binary'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'body'
op|'='
op|'{'
string|"'host'"
op|':'
string|"'host1'"
op|','
string|"'binary'"
op|':'
string|"'invalid'"
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'webob'
op|'.'
name|'exc'
op|'.'
name|'HTTPNotFound'
op|','
nl|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'update'
op|','
nl|'\n'
name|'self'
op|'.'
name|'req'
op|','
nl|'\n'
string|'"disable"'
op|','
nl|'\n'
name|'body'
op|'='
name|'body'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_disable_log_reason
dedent|''
name|'def'
name|'test_services_disable_log_reason'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'body'
op|'='
op|'{'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test-reason'"
op|','
nl|'\n'
op|'}'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'update'
op|'('
name|'self'
op|'.'
name|'req'
op|','
nl|'\n'
string|'"disable-log-reason"'
op|','
nl|'\n'
name|'body'
op|'='
name|'body'
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|'['
string|"'service'"
op|']'
op|'['
string|"'status'"
op|']'
op|','
string|"'disabled'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|'['
string|"'service'"
op|']'
op|'['
string|"'disabled_reason'"
op|']'
op|','
string|"'test-reason'"
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_mandatory_reason_field
dedent|''
name|'def'
name|'test_mandatory_reason_field'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'body'
op|'='
op|'{'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'webob'
op|'.'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'update'
op|','
name|'self'
op|'.'
name|'req'
op|','
string|'"disable-log-reason"'
op|','
nl|'\n'
name|'body'
op|'='
name|'body'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_invalid_reason_field
dedent|''
name|'def'
name|'test_invalid_reason_field'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'reason'
op|'='
string|"'a'"
op|'*'
number|'256'
newline|'\n'
name|'body'
op|'='
op|'{'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
name|'reason'
op|','
nl|'\n'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'self'
op|'.'
name|'bad_request'
op|','
nl|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'update'
op|','
name|'self'
op|'.'
name|'req'
op|','
string|'"disable-log-reason"'
op|','
nl|'\n'
name|'body'
op|'='
name|'body'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_delete
dedent|''
name|'def'
name|'test_services_delete'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services-delete'"
op|']'
op|'='
name|'True'
newline|'\n'
nl|'\n'
name|'with'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'self'
op|'.'
name|'controller'
op|'.'
name|'host_api'
op|','
nl|'\n'
string|"'service_delete'"
op|')'
name|'as'
name|'service_delete'
op|':'
newline|'\n'
indent|'            '
name|'self'
op|'.'
name|'controller'
op|'.'
name|'delete'
op|'('
name|'self'
op|'.'
name|'req'
op|','
string|"'1'"
op|')'
newline|'\n'
name|'service_delete'
op|'.'
name|'assert_called_once_with'
op|'('
nl|'\n'
name|'self'
op|'.'
name|'req'
op|'.'
name|'environ'
op|'['
string|"'nova.context'"
op|']'
op|','
string|"'1'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'self'
op|'.'
name|'controller'
op|'.'
name|'delete'
op|'.'
name|'wsgi_code'
op|','
number|'204'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_delete_not_found
dedent|''
dedent|''
name|'def'
name|'test_services_delete_not_found'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services-delete'"
op|']'
op|'='
name|'True'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'webob'
op|'.'
name|'exc'
op|'.'
name|'HTTPNotFound'
op|','
nl|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'delete'
op|','
name|'self'
op|'.'
name|'req'
op|','
number|'1234'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_delete_bad_request
dedent|''
name|'def'
name|'test_services_delete_bad_request'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services-delete'"
op|']'
op|'='
name|'True'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'webob'
op|'.'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'delete'
op|','
name|'self'
op|'.'
name|'req'
op|','
string|"'abc'"
op|')'
newline|'\n'
nl|'\n'
comment|'# This test is just to verify that the servicegroup API gets used when'
nl|'\n'
comment|'# calling the API'
nl|'\n'
dedent|''
op|'@'
name|'mock'
op|'.'
name|'patch'
op|'.'
name|'object'
op|'('
name|'db_driver'
op|'.'
name|'DbDriver'
op|','
string|"'is_up'"
op|','
name|'side_effect'
op|'='
name|'KeyError'
op|')'
newline|'\n'
DECL|member|test_services_with_exception
name|'def'
name|'test_services_with_exception'
op|'('
name|'self'
op|','
name|'mock_is_up'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'req'
op|'='
name|'FakeRequestWithHostService'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertRaises'
op|'('
name|'self'
op|'.'
name|'service_is_up_exc'
op|','
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|','
name|'req'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|ServicesTestV211
dedent|''
dedent|''
name|'class'
name|'ServicesTestV211'
op|'('
name|'ServicesTestV21'
op|')'
op|':'
newline|'\n'
DECL|variable|wsgi_api_version
indent|'    '
name|'wsgi_api_version'
op|'='
string|"'2.11'"
newline|'\n'
nl|'\n'
DECL|member|test_services_list
name|'def'
name|'test_services_list'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'req'
op|'='
name|'FakeRequest'
op|'('
name|'self'
op|'.'
name|'wsgi_api_version'
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test1'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'3'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'enabled'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'19'
op|','
number|'6'
op|','
number|'55'
op|','
number|'34'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'4'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test4'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|')'
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_list_with_host
dedent|''
name|'def'
name|'test_services_list_with_host'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'req'
op|'='
name|'FakeRequestWithHost'
op|'('
name|'self'
op|'.'
name|'wsgi_api_version'
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test1'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_list_with_service
dedent|''
name|'def'
name|'test_services_list_with_service'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'req'
op|'='
name|'FakeRequestWithService'
op|'('
name|'self'
op|'.'
name|'wsgi_api_version'
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test4'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'4'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|')'
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_list_with_host_service
dedent|''
name|'def'
name|'test_services_list_with_host_service'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'req'
op|'='
name|'FakeRequestWithHostService'
op|'('
name|'self'
op|'.'
name|'wsgi_api_version'
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_detail
dedent|''
name|'def'
name|'test_services_detail'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'req'
op|'='
name|'FakeRequest'
op|'('
name|'self'
op|'.'
name|'wsgi_api_version'
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test1'"
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'enabled'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'3'
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'19'
op|','
number|'6'
op|','
number|'55'
op|','
number|'34'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
name|'None'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'4'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test4'"
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|','
name|'has_disabled'
op|'='
name|'True'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_service_detail_with_host
dedent|''
name|'def'
name|'test_service_detail_with_host'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'req'
op|'='
name|'FakeRequestWithHost'
op|'('
name|'self'
op|'.'
name|'wsgi_api_version'
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test1'"
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|','
name|'has_disabled'
op|'='
name|'True'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_service_detail_with_service
dedent|''
name|'def'
name|'test_service_detail_with_service'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'req'
op|'='
name|'FakeRequestWithService'
op|'('
name|'self'
op|'.'
name|'wsgi_api_version'
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'4'
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test4'"
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|','
name|'has_disabled'
op|'='
name|'True'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_service_detail_with_host_service
dedent|''
name|'def'
name|'test_service_detail_with_host_service'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'req'
op|'='
name|'FakeRequestWithHostService'
op|'('
name|'self'
op|'.'
name|'wsgi_api_version'
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|','
name|'has_disabled'
op|'='
name|'True'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_detail_with_delete_extension
dedent|''
name|'def'
name|'test_services_detail_with_delete_extension'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services-delete'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'req'
op|'='
name|'FakeRequest'
op|'('
name|'self'
op|'.'
name|'wsgi_api_version'
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
nl|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'1'
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test1'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'2'
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test2'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
name|'None'
op|','
nl|'\n'
string|"'id'"
op|':'
number|'3'
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'enabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'19'
op|','
number|'6'
op|','
number|'55'
op|','
number|'34'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'host2'"
op|','
nl|'\n'
string|"'id'"
op|':'
number|'4'
op|','
nl|'\n'
string|"'disabled_reason'"
op|':'
string|"'test4'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'forced_down'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|')'
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_output'
op|'('
name|'response'
op|','
name|'has_id'
op|'='
name|'True'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'res_dict'
op|','
name|'response'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|ServicesCellsTestV21
dedent|''
dedent|''
name|'class'
name|'ServicesCellsTestV21'
op|'('
name|'test'
op|'.'
name|'TestCase'
op|')'
op|':'
newline|'\n'
nl|'\n'
DECL|member|setUp
indent|'    '
name|'def'
name|'setUp'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'super'
op|'('
name|'ServicesCellsTestV21'
op|','
name|'self'
op|')'
op|'.'
name|'setUp'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'host_api'
op|'='
name|'cells_api'
op|'.'
name|'HostAPI'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'ext_mgr'
op|'='
name|'extensions'
op|'.'
name|'ExtensionManager'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'='
op|'{'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_set_up_controller'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'host_api'
op|'='
name|'host_api'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'useFixture'
op|'('
name|'utils_fixture'
op|'.'
name|'TimeFixture'
op|'('
name|'fake_utcnow'
op|'('
op|')'
op|')'
op|')'
newline|'\n'
nl|'\n'
name|'services_list'
op|'='
op|'['
op|']'
newline|'\n'
name|'for'
name|'service'
name|'in'
name|'fake_services_list'
op|':'
newline|'\n'
indent|'            '
name|'service'
op|'='
name|'service'
op|'.'
name|'copy'
op|'('
op|')'
newline|'\n'
name|'del'
name|'service'
op|'['
string|"'version'"
op|']'
newline|'\n'
name|'service_obj'
op|'='
name|'objects'
op|'.'
name|'Service'
op|'('
op|'**'
name|'service'
op|')'
newline|'\n'
name|'service_proxy'
op|'='
name|'cells_utils'
op|'.'
name|'ServiceProxy'
op|'('
name|'service_obj'
op|','
string|"'cell1'"
op|')'
newline|'\n'
name|'services_list'
op|'.'
name|'append'
op|'('
name|'service_proxy'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'host_api'
op|'.'
name|'cells_rpcapi'
op|'.'
name|'service_get_all'
op|'='
op|'('
nl|'\n'
name|'mock'
op|'.'
name|'Mock'
op|'('
name|'side_effect'
op|'='
name|'fake_service_get_all'
op|'('
name|'services_list'
op|')'
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_set_up_controller
dedent|''
name|'def'
name|'_set_up_controller'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'controller'
op|'='
name|'services_v21'
op|'.'
name|'ServiceController'
op|'('
op|')'
newline|'\n'
nl|'\n'
DECL|member|_process_out
dedent|''
name|'def'
name|'_process_out'
op|'('
name|'self'
op|','
name|'res_dict'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'for'
name|'res'
name|'in'
name|'res_dict'
op|'['
string|"'services'"
op|']'
op|':'
newline|'\n'
indent|'            '
name|'res'
op|'.'
name|'pop'
op|'('
string|"'disabled_reason'"
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_services_detail
dedent|''
dedent|''
name|'def'
name|'test_services_detail'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'extensions'
op|'['
string|"'os-extended-services-delete'"
op|']'
op|'='
name|'True'
newline|'\n'
name|'req'
op|'='
name|'FakeRequest'
op|'('
op|')'
newline|'\n'
name|'res_dict'
op|'='
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|'('
name|'req'
op|')'
newline|'\n'
name|'utc'
op|'='
name|'iso8601'
op|'.'
name|'iso8601'
op|'.'
name|'Utc'
op|'('
op|')'
newline|'\n'
name|'response'
op|'='
op|'{'
string|"'services'"
op|':'
op|'['
nl|'\n'
op|'{'
string|"'id'"
op|':'
string|"'cell1@1'"
op|','
nl|'\n'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'cell1@host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'2'
op|','
nl|'\n'
name|'tzinfo'
op|'='
name|'utc'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'id'"
op|':'
string|"'cell1@2'"
op|','
nl|'\n'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'cell1@host1'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'up'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'10'
op|','
number|'29'
op|','
number|'13'
op|','
number|'42'
op|','
number|'5'
op|','
nl|'\n'
name|'tzinfo'
op|'='
name|'utc'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'id'"
op|':'
string|"'cell1@3'"
op|','
nl|'\n'
string|"'binary'"
op|':'
string|"'nova-scheduler'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'cell1@host2'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'internal'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'enabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'19'
op|','
number|'6'
op|','
number|'55'
op|','
number|'34'
op|','
nl|'\n'
name|'tzinfo'
op|'='
name|'utc'
op|')'
op|'}'
op|','
nl|'\n'
op|'{'
string|"'id'"
op|':'
string|"'cell1@4'"
op|','
nl|'\n'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|','
nl|'\n'
string|"'host'"
op|':'
string|"'cell1@host2'"
op|','
nl|'\n'
string|"'zone'"
op|':'
string|"'nova'"
op|','
nl|'\n'
string|"'status'"
op|':'
string|"'disabled'"
op|','
nl|'\n'
string|"'state'"
op|':'
string|"'down'"
op|','
nl|'\n'
string|"'updated_at'"
op|':'
name|'datetime'
op|'.'
name|'datetime'
op|'('
number|'2012'
op|','
number|'9'
op|','
number|'18'
op|','
number|'8'
op|','
number|'3'
op|','
number|'38'
op|','
nl|'\n'
name|'tzinfo'
op|'='
name|'utc'
op|')'
op|'}'
op|']'
op|'}'
newline|'\n'
name|'self'
op|'.'
name|'_process_out'
op|'('
name|'res_dict'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
name|'response'
op|','
name|'res_dict'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|ServicesPolicyEnforcementV21
dedent|''
dedent|''
name|'class'
name|'ServicesPolicyEnforcementV21'
op|'('
name|'test'
op|'.'
name|'NoDBTestCase'
op|')'
op|':'
newline|'\n'
nl|'\n'
DECL|member|setUp
indent|'    '
name|'def'
name|'setUp'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'super'
op|'('
name|'ServicesPolicyEnforcementV21'
op|','
name|'self'
op|')'
op|'.'
name|'setUp'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'controller'
op|'='
name|'services_v21'
op|'.'
name|'ServiceController'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'req'
op|'='
name|'fakes'
op|'.'
name|'HTTPRequest'
op|'.'
name|'blank'
op|'('
string|"''"
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_update_policy_failed
dedent|''
name|'def'
name|'test_update_policy_failed'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'rule_name'
op|'='
string|'"os_compute_api:os-services"'
newline|'\n'
name|'self'
op|'.'
name|'policy'
op|'.'
name|'set_rules'
op|'('
op|'{'
name|'rule_name'
op|':'
string|'"project_id:non_fake"'
op|'}'
op|')'
newline|'\n'
name|'exc'
op|'='
name|'self'
op|'.'
name|'assertRaises'
op|'('
nl|'\n'
name|'exception'
op|'.'
name|'PolicyNotAuthorized'
op|','
nl|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'update'
op|','
name|'self'
op|'.'
name|'req'
op|','
name|'fakes'
op|'.'
name|'FAKE_UUID'
op|','
nl|'\n'
name|'body'
op|'='
op|'{'
string|"'host'"
op|':'
string|"'host1'"
op|','
nl|'\n'
string|"'binary'"
op|':'
string|"'nova-compute'"
op|'}'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
nl|'\n'
string|'"Policy doesn\'t allow %s to be performed."'
op|'%'
name|'rule_name'
op|','
nl|'\n'
name|'exc'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_delete_policy_failed
dedent|''
name|'def'
name|'test_delete_policy_failed'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'rule_name'
op|'='
string|'"os_compute_api:os-services"'
newline|'\n'
name|'self'
op|'.'
name|'policy'
op|'.'
name|'set_rules'
op|'('
op|'{'
name|'rule_name'
op|':'
string|'"project_id:non_fake"'
op|'}'
op|')'
newline|'\n'
name|'exc'
op|'='
name|'self'
op|'.'
name|'assertRaises'
op|'('
nl|'\n'
name|'exception'
op|'.'
name|'PolicyNotAuthorized'
op|','
nl|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'delete'
op|','
name|'self'
op|'.'
name|'req'
op|','
name|'fakes'
op|'.'
name|'FAKE_UUID'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
nl|'\n'
string|'"Policy doesn\'t allow %s to be performed."'
op|'%'
name|'rule_name'
op|','
nl|'\n'
name|'exc'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|test_index_policy_failed
dedent|''
name|'def'
name|'test_index_policy_failed'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'rule_name'
op|'='
string|'"os_compute_api:os-services"'
newline|'\n'
name|'self'
op|'.'
name|'policy'
op|'.'
name|'set_rules'
op|'('
op|'{'
name|'rule_name'
op|':'
string|'"project_id:non_fake"'
op|'}'
op|')'
newline|'\n'
name|'exc'
op|'='
name|'self'
op|'.'
name|'assertRaises'
op|'('
nl|'\n'
name|'exception'
op|'.'
name|'PolicyNotAuthorized'
op|','
nl|'\n'
name|'self'
op|'.'
name|'controller'
op|'.'
name|'index'
op|','
name|'self'
op|'.'
name|'req'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'assertEqual'
op|'('
nl|'\n'
string|'"Policy doesn\'t allow %s to be performed."'
op|'%'
name|'rule_name'
op|','
nl|'\n'
name|'exc'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
dedent|''
endmarker|''
end_unit
