@@ -16,7 +16,7 @@ class HealthcheckTest(BaseAPIIntegrationTest):
16
16
@helpers .requires_api_version ('1.24' )
17
17
def test_healthcheck_shell_command (self ):
18
18
container = self .client .create_container (
19
- TEST_IMG , 'top' , healthcheck = dict ( test = ' echo "hello world"') )
19
+ TEST_IMG , 'top' , healthcheck = { ' test' : ' echo "hello world"'} )
20
20
self .tmp_containers .append (container )
21
21
22
22
res = self .client .inspect_container (container )
@@ -27,40 +27,40 @@ def test_healthcheck_shell_command(self):
27
27
@helpers .requires_api_version ('1.24' )
28
28
def test_healthcheck_passes (self ):
29
29
container = self .client .create_container (
30
- TEST_IMG , 'top' , healthcheck = dict (
31
- test = "true" ,
32
- interval = 1 * SECOND ,
33
- timeout = 1 * SECOND ,
34
- retries = 1 ,
35
- ) )
30
+ TEST_IMG , 'top' , healthcheck = {
31
+ ' test' : "true" ,
32
+ ' interval' : 1 * SECOND ,
33
+ ' timeout' : 1 * SECOND ,
34
+ ' retries' : 1 ,
35
+ } )
36
36
self .tmp_containers .append (container )
37
37
self .client .start (container )
38
38
wait_on_health_status (self .client , container , "healthy" )
39
39
40
40
@helpers .requires_api_version ('1.24' )
41
41
def test_healthcheck_fails (self ):
42
42
container = self .client .create_container (
43
- TEST_IMG , 'top' , healthcheck = dict (
44
- test = "false" ,
45
- interval = 1 * SECOND ,
46
- timeout = 1 * SECOND ,
47
- retries = 1 ,
48
- ) )
43
+ TEST_IMG , 'top' , healthcheck = {
44
+ ' test' : "false" ,
45
+ ' interval' : 1 * SECOND ,
46
+ ' timeout' : 1 * SECOND ,
47
+ ' retries' : 1 ,
48
+ } )
49
49
self .tmp_containers .append (container )
50
50
self .client .start (container )
51
51
wait_on_health_status (self .client , container , "unhealthy" )
52
52
53
53
@helpers .requires_api_version ('1.29' )
54
54
def test_healthcheck_start_period (self ):
55
55
container = self .client .create_container (
56
- TEST_IMG , 'top' , healthcheck = dict (
57
- test = "echo 'x' >> /counter.txt && "
56
+ TEST_IMG , 'top' , healthcheck = {
57
+ ' test' : "echo 'x' >> /counter.txt && "
58
58
"test `cat /counter.txt | wc -l` -ge 3" ,
59
- interval = 1 * SECOND ,
60
- timeout = 1 * SECOND ,
61
- retries = 1 ,
62
- start_period = 3 * SECOND
63
- )
59
+ ' interval' : 1 * SECOND ,
60
+ ' timeout' : 1 * SECOND ,
61
+ ' retries' : 1 ,
62
+ ' start_period' : 3 * SECOND
63
+ }
64
64
)
65
65
66
66
self .tmp_containers .append (container )
0 commit comments