12
12
_http_getresponse_method = ''
13
13
14
14
try :
15
- from httplib import HTTPConnection , OK , NOT_FOUND
15
+ from httplib import HTTPConnection , OK , NOT_FOUND # NOQA
16
16
_http_request_method = 'httplib.HTTPConnection.request'
17
17
_http_getresponse_method = 'httplib.HTTPConnection.getresponse'
18
18
except ImportError :
19
- from http .client import HTTPConnection , OK , NOT_FOUND
19
+ from http .client import HTTPConnection , OK , NOT_FOUND # NOQA
20
20
_http_request_method = 'http.client.HTTPConnection.request'
21
21
_http_getresponse_method = 'http.client.HTTPConnection.getresponse'
22
22
@@ -118,10 +118,10 @@ def getheader(self, header_key, default_return):
118
118
http_getresponse_mock .return_value = ResponseMock (OK , {})
119
119
self .assertTrue (hadoop_conf ._check_is_active_rm ('example2' , '8022' ))
120
120
http_getresponse_mock .reset_mock ()
121
- http_getresponse_mock .return_value = ResponseMock (OK , {'Refresh' :"testing" })
121
+ http_getresponse_mock .return_value = ResponseMock (OK , {'Refresh' : "testing" })
122
122
self .assertFalse (hadoop_conf ._check_is_active_rm ('example2' , '8022' ))
123
123
http_getresponse_mock .reset_mock ()
124
- http_getresponse_mock .return_value = ResponseMock (NOT_FOUND , {'Refresh' :"testing" })
124
+ http_getresponse_mock .return_value = ResponseMock (NOT_FOUND , {'Refresh' : "testing" })
125
125
self .assertFalse (hadoop_conf ._check_is_active_rm ('example2' , '8022' ))
126
126
http_conn_request_mock .side_effect = Exception ('error' )
127
127
http_conn_request_mock .reset_mock ()
@@ -136,14 +136,12 @@ def test_get_resource_manager(self):
136
136
host_port = hadoop_conf ._get_resource_manager (hadoop_conf .CONF_DIR , None )
137
137
138
138
self .assertEqual (('example.com' , '8022' ), host_port )
139
- parse_mock .assert_called_with ('/etc/hadoop/conf/yarn-site.xml' ,
140
- 'yarn.resourcemanager.webapp.address' )
139
+ parse_mock .assert_called_with ('/etc/hadoop/conf/yarn-site.xml' , 'yarn.resourcemanager.webapp.address' )
141
140
142
141
host_port = hadoop_conf ._get_resource_manager (hadoop_conf .CONF_DIR , 'rm1' )
143
142
144
143
self .assertEqual (('example.com' , '8022' ), host_port )
145
- parse_mock .assert_called_with ('/etc/hadoop/conf/yarn-site.xml' ,
146
- 'yarn.resourcemanager.webapp.address.rm1' )
144
+ parse_mock .assert_called_with ('/etc/hadoop/conf/yarn-site.xml' , 'yarn.resourcemanager.webapp.address.rm1' )
147
145
148
146
parse_mock .reset_mock ()
149
147
parse_mock .return_value = None
0 commit comments