mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Fix/improve tests (#1052)
* Improve unit test condition. * Improve/fix tests.
This commit is contained in:
@@ -109,9 +109,9 @@
|
||||
- present_1_check.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
- present_1 is changed
|
||||
- present_1.containers | length == 1
|
||||
- present_1.containers[0].Name == pname ~ '-' ~ cname ~ '-1'
|
||||
- present_1.containers[0].Name == (pname ~ '-' ~ cname ~ '-1')
|
||||
- present_1.images | length == 1
|
||||
- present_1.images[0].ContainerName == pname ~ '-' ~ cname ~ '-1'
|
||||
- present_1.images[0].ContainerName == (pname ~ '-' ~ cname ~ '-1')
|
||||
- present_1.images[0].Repository == iname
|
||||
- present_1.images[0].Tag == "latest"
|
||||
- present_1.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
|
||||
@@ -57,12 +57,12 @@
|
||||
- present_1_check.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
- present_1 is failed
|
||||
- present_1.containers | length == 1
|
||||
- present_1.containers[0].Name == pname ~ '-' ~ cname ~ '-1'
|
||||
- present_1.containers[0].Name == (pname ~ '-' ~ cname ~ '-1')
|
||||
- present_1.containers[0].Image == docker_test_image_alpine
|
||||
- present_1.containers[0].State == 'exited'
|
||||
- present_1.containers[0].ExitCode == 0
|
||||
- present_1.images | length == 1
|
||||
- present_1.images[0].ContainerName == pname ~ '-' ~ cname ~ '-1'
|
||||
- present_1.images[0].ContainerName == (pname ~ '-' ~ cname ~ '-1')
|
||||
- present_1.images[0].Repository == (docker_test_image_alpine | split(':') | first)
|
||||
- present_1.images[0].Tag == (docker_test_image_alpine | split(':') | last)
|
||||
- present_1.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
|
||||
@@ -80,10 +80,10 @@
|
||||
- present_1_check.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
- present_1 is changed
|
||||
- present_1.containers | length == 1
|
||||
- present_1.containers[0].Name == pname ~ '-' ~ cname ~ '-1'
|
||||
- present_1.containers[0].Name == (pname ~ '-' ~ cname ~ '-1')
|
||||
- present_1.containers[0].Image == docker_test_image_alpine
|
||||
- present_1.images | length == 1
|
||||
- present_1.images[0].ContainerName == pname ~ '-' ~ cname ~ '-1'
|
||||
- present_1.images[0].ContainerName == (pname ~ '-' ~ cname ~ '-1')
|
||||
- present_1.images[0].Repository == (docker_test_image_alpine | split(':') | first)
|
||||
- present_1.images[0].Tag == (docker_test_image_alpine | split(':') | last)
|
||||
- present_1.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
|
||||
@@ -190,24 +190,24 @@
|
||||
- assert:
|
||||
that:
|
||||
- present_1_check is changed
|
||||
- present_1_check.actions | selectattr('status', 'eq', 'Pulling') | first
|
||||
- present_1_check.actions | selectattr('status', 'eq', 'Creating') | first
|
||||
- (present_1_check.actions | selectattr('status', 'eq', 'Pulling') | first) is truthy
|
||||
- (present_1_check.actions | selectattr('status', 'eq', 'Creating') | first) is truthy
|
||||
- present_1_check.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
- present_1 is changed
|
||||
- present_1.actions | selectattr('status', 'eq', 'Pulling') | first
|
||||
- present_1.actions | selectattr('status', 'eq', 'Creating') | first
|
||||
- (present_1.actions | selectattr('status', 'eq', 'Pulling') | first) is truthy
|
||||
- (present_1.actions | selectattr('status', 'eq', 'Creating') | first) is truthy
|
||||
- present_1.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
- present_2_check is not changed
|
||||
- present_2_check.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
- present_2 is not changed
|
||||
- present_2.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
- present_3_check is changed
|
||||
- present_3_check.actions | selectattr('status', 'eq', 'Pulling') | first
|
||||
- (present_3_check.actions | selectattr('status', 'eq', 'Pulling') | first) is truthy
|
||||
- present_3_check.actions | selectattr('status', 'eq', 'Creating') | length == 0
|
||||
- present_3_check.actions | selectattr('status', 'eq', 'Recreating') | length == 0
|
||||
- present_3_check.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
- present_3 is not changed
|
||||
- present_3.actions | selectattr('status', 'eq', 'Pulling') | first
|
||||
- (present_3.actions | selectattr('status', 'eq', 'Pulling') | first) is truthy
|
||||
- present_3.actions | selectattr('status', 'eq', 'Creating') | length == 0
|
||||
- present_3.actions | selectattr('status', 'eq', 'Recreating') | length == 0
|
||||
- present_3.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
|
||||
@@ -90,10 +90,10 @@
|
||||
- present_1_check.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
- present_1 is changed
|
||||
- present_1.containers | length == 1
|
||||
- present_1.containers[0].Name == pname ~ '-' ~ cname ~ '-1'
|
||||
- present_1.containers[0].Name == (pname ~ '-' ~ cname ~ '-1')
|
||||
- present_1.containers[0].Image == docker_test_image_alpine
|
||||
- present_1.images | length == 1
|
||||
- present_1.images[0].ContainerName == pname ~ '-' ~ cname ~ '-1'
|
||||
- present_1.images[0].ContainerName == (pname ~ '-' ~ cname ~ '-1')
|
||||
- present_1.images[0].Repository == (docker_test_image_alpine | split(':') | first)
|
||||
- present_1.images[0].Tag == (docker_test_image_alpine | split(':') | last)
|
||||
- present_1.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
|
||||
|
||||
Reference in New Issue
Block a user