@@ -102,7 +102,7 @@ def test_create_with_links(self):
102
102
container3_id = res2 ['Id' ]
103
103
self .tmp_containers .append (container3_id )
104
104
self .client .start (container3_id )
105
- assert self .client .wait (container3_id ) == 0
105
+ assert self .client .wait (container3_id )[ 'StatusCode' ] == 0
106
106
107
107
logs = self .client .logs (container3_id )
108
108
if six .PY3 :
@@ -169,7 +169,7 @@ def create_container_readonly_fs(self):
169
169
assert 'Id' in ctnr
170
170
self .tmp_containers .append (ctnr ['Id' ])
171
171
self .client .start (ctnr )
172
- res = self .client .wait (ctnr )
172
+ res = self .client .wait (ctnr )[ 'StatusCode' ]
173
173
assert res != 0
174
174
175
175
def create_container_with_name (self ):
@@ -771,7 +771,7 @@ def test_run_shlex_commands(self):
771
771
id = container ['Id' ]
772
772
self .client .start (id )
773
773
self .tmp_containers .append (id )
774
- exitcode = self .client .wait (id )
774
+ exitcode = self .client .wait (id )[ 'StatusCode' ]
775
775
assert exitcode == 0 , cmd
776
776
777
777
@@ -781,7 +781,7 @@ def test_wait(self):
781
781
id = res ['Id' ]
782
782
self .tmp_containers .append (id )
783
783
self .client .start (id )
784
- exitcode = self .client .wait (id )
784
+ exitcode = self .client .wait (id )[ 'StatusCode' ]
785
785
assert exitcode == 0
786
786
inspect = self .client .inspect_container (id )
787
787
assert 'Running' in inspect ['State' ]
@@ -794,7 +794,7 @@ def test_wait_with_dict_instead_of_id(self):
794
794
id = res ['Id' ]
795
795
self .tmp_containers .append (id )
796
796
self .client .start (res )
797
- exitcode = self .client .wait (res )
797
+ exitcode = self .client .wait (res )[ 'StatusCode' ]
798
798
assert exitcode == 0
799
799
inspect = self .client .inspect_container (res )
800
800
assert 'Running' in inspect ['State' ]
@@ -815,7 +815,9 @@ def test_wait_with_condition(self):
815
815
)
816
816
self .tmp_containers .append (ctnr )
817
817
self .client .start (ctnr )
818
- assert self .client .wait (ctnr , condition = 'removed' , timeout = 5 ) == 0
818
+ assert self .client .wait (
819
+ ctnr , condition = 'removed' , timeout = 5
820
+ )['StatusCode' ] == 0
819
821
820
822
821
823
class LogsTest (BaseAPIIntegrationTest ):
@@ -827,7 +829,7 @@ def test_logs(self):
827
829
id = container ['Id' ]
828
830
self .tmp_containers .append (id )
829
831
self .client .start (id )
830
- exitcode = self .client .wait (id )
832
+ exitcode = self .client .wait (id )[ 'StatusCode' ]
831
833
assert exitcode == 0
832
834
logs = self .client .logs (id )
833
835
assert logs == (snippet + '\n ' ).encode (encoding = 'ascii' )
@@ -841,7 +843,7 @@ def test_logs_tail_option(self):
841
843
id = container ['Id' ]
842
844
self .tmp_containers .append (id )
843
845
self .client .start (id )
844
- exitcode = self .client .wait (id )
846
+ exitcode = self .client .wait (id )[ 'StatusCode' ]
845
847
assert exitcode == 0
846
848
logs = self .client .logs (id , tail = 1 )
847
849
assert logs == 'Line2\n ' .encode (encoding = 'ascii' )
@@ -858,7 +860,7 @@ def test_logs_streaming_and_follow(self):
858
860
for chunk in self .client .logs (id , stream = True , follow = True ):
859
861
logs += chunk
860
862
861
- exitcode = self .client .wait (id )
863
+ exitcode = self .client .wait (id )[ 'StatusCode' ]
862
864
assert exitcode == 0
863
865
864
866
assert logs == (snippet + '\n ' ).encode (encoding = 'ascii' )
@@ -871,7 +873,7 @@ def test_logs_with_dict_instead_of_id(self):
871
873
id = container ['Id' ]
872
874
self .tmp_containers .append (id )
873
875
self .client .start (id )
874
- exitcode = self .client .wait (id )
876
+ exitcode = self .client .wait (id )[ 'StatusCode' ]
875
877
assert exitcode == 0
876
878
logs = self .client .logs (container )
877
879
assert logs == (snippet + '\n ' ).encode (encoding = 'ascii' )
@@ -884,7 +886,7 @@ def test_logs_with_tail_0(self):
884
886
id = container ['Id' ]
885
887
self .tmp_containers .append (id )
886
888
self .client .start (id )
887
- exitcode = self .client .wait (id )
889
+ exitcode = self .client .wait (id )[ 'StatusCode' ]
888
890
assert exitcode == 0
889
891
logs = self .client .logs (id , tail = 0 )
890
892
assert logs == '' .encode (encoding = 'ascii' )
@@ -898,7 +900,7 @@ def test_logs_with_until(self):
898
900
899
901
self .tmp_containers .append (container )
900
902
self .client .start (container )
901
- exitcode = self .client .wait (container )
903
+ exitcode = self .client .wait (container )[ 'StatusCode' ]
902
904
assert exitcode == 0
903
905
logs_until_1 = self .client .logs (container , until = 1 )
904
906
assert logs_until_1 == b''
@@ -912,7 +914,7 @@ def test_diff(self):
912
914
id = container ['Id' ]
913
915
self .client .start (id )
914
916
self .tmp_containers .append (id )
915
- exitcode = self .client .wait (id )
917
+ exitcode = self .client .wait (id )[ 'StatusCode' ]
916
918
assert exitcode == 0
917
919
diff = self .client .diff (id )
918
920
test_diff = [x for x in diff if x .get ('Path' , None ) == '/test' ]
@@ -925,7 +927,7 @@ def test_diff_with_dict_instead_of_id(self):
925
927
id = container ['Id' ]
926
928
self .client .start (id )
927
929
self .tmp_containers .append (id )
928
- exitcode = self .client .wait (id )
930
+ exitcode = self .client .wait (id )[ 'StatusCode' ]
929
931
assert exitcode == 0
930
932
diff = self .client .diff (container )
931
933
test_diff = [x for x in diff if x .get ('Path' , None ) == '/test' ]
@@ -997,7 +999,7 @@ def test_kill_with_signal(self):
997
999
self .client .kill (
998
1000
id , signal = signal .SIGKILL if not IS_WINDOWS_PLATFORM else 9
999
1001
)
1000
- exitcode = self .client .wait (id )
1002
+ exitcode = self .client .wait (id )[ 'StatusCode' ]
1001
1003
assert exitcode != 0
1002
1004
container_info = self .client .inspect_container (id )
1003
1005
assert 'State' in container_info
@@ -1012,7 +1014,7 @@ def test_kill_with_signal_name(self):
1012
1014
self .client .start (id )
1013
1015
self .tmp_containers .append (id )
1014
1016
self .client .kill (id , signal = 'SIGKILL' )
1015
- exitcode = self .client .wait (id )
1017
+ exitcode = self .client .wait (id )[ 'StatusCode' ]
1016
1018
assert exitcode != 0
1017
1019
container_info = self .client .inspect_container (id )
1018
1020
assert 'State' in container_info
@@ -1027,7 +1029,7 @@ def test_kill_with_signal_integer(self):
1027
1029
self .client .start (id )
1028
1030
self .tmp_containers .append (id )
1029
1031
self .client .kill (id , signal = 9 )
1030
- exitcode = self .client .wait (id )
1032
+ exitcode = self .client .wait (id )[ 'StatusCode' ]
1031
1033
assert exitcode != 0
1032
1034
container_info = self .client .inspect_container (id )
1033
1035
assert 'State' in container_info
0 commit comments