File tree Expand file tree Collapse file tree 2 files changed +10
-37
lines changed Expand file tree Collapse file tree 2 files changed +10
-37
lines changed Original file line number Diff line number Diff line change @@ -751,14 +751,18 @@ def test_create_container_with_port_binds(self):
751
751
)
752
752
753
753
def test_create_container_with_mac_address (self ):
754
- mac_address_expected = "02:42:ac:11:00:0a"
754
+ expected = "02:42:ac:11:00:0a"
755
755
756
- container = self .client .create_container (
757
- 'busybox' , ['sleep' , '60' ], mac_address = mac_address_expected )
756
+ self .client .create_container (
757
+ 'busybox' ,
758
+ ['sleep' , '60' ],
759
+ mac_address = expected
760
+ )
758
761
759
- res = self .client .inspect_container (container ['Id' ])
760
- self .assertEqual (mac_address_expected ,
761
- res ['NetworkSettings' ]['MacAddress' ])
762
+ args = fake_request .call_args
763
+ self .assertEqual (args [0 ][1 ], url_prefix + 'containers/create' )
764
+ data = json .loads (args [1 ]['data' ])
765
+ assert data ['MacAddress' ] == expected
762
766
763
767
def test_create_container_with_links (self ):
764
768
link_path = 'path'
Original file line number Diff line number Diff line change @@ -169,35 +169,6 @@ def get_fake_inspect_image():
169
169
return status_code , response
170
170
171
171
172
- def get_fake_port ():
173
- status_code = 200
174
- response = {
175
- 'HostConfig' : {
176
- 'Binds' : None ,
177
- 'ContainerIDFile' : '' ,
178
- 'Links' : None ,
179
- 'LxcConf' : None ,
180
- 'PortBindings' : {
181
- '1111' : None ,
182
- '1111/tcp' : [{'HostIp' : '127.0.0.1' , 'HostPort' : '4567' }],
183
- '2222' : None
184
- },
185
- 'Privileged' : False ,
186
- 'PublishAllPorts' : False
187
- },
188
- 'NetworkSettings' : {
189
- 'Bridge' : 'docker0' ,
190
- 'PortMapping' : None ,
191
- 'Ports' : {
192
- '1111' : None ,
193
- '1111/tcp' : [{'HostIp' : '127.0.0.1' , 'HostPort' : '4567' }],
194
- '2222' : None },
195
- 'MacAddress' : '02:42:ac:11:00:0a'
196
- }
197
- }
198
- return status_code , response
199
-
200
-
201
172
def get_fake_insert_image ():
202
173
status_code = 200
203
174
response = {'StatusCode' : 0 }
@@ -495,8 +466,6 @@ def post_fake_update_container():
495
466
post_fake_pause_container ,
496
467
'{1}/{0}/containers/3cc2351ab11b/unpause' .format (CURRENT_VERSION , prefix ):
497
468
post_fake_unpause_container ,
498
- '{1}/{0}/containers/3cc2351ab11b/json' .format (CURRENT_VERSION , prefix ):
499
- get_fake_port ,
500
469
'{1}/{0}/containers/3cc2351ab11b/restart' .format (CURRENT_VERSION , prefix ):
501
470
post_fake_restart_container ,
502
471
'{1}/{0}/containers/3cc2351ab11b' .format (CURRENT_VERSION , prefix ):
You can’t perform that action at this time.
0 commit comments