mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Unittest the get_split_image_tag function in the docker module
This commit is contained in:
parent
bfb4a0c83a
commit
b95475c1f9
2 changed files with 21 additions and 1 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 6be2fbb1c577d34b0dbb51c7338da0b79286658f
|
||||
Subproject commit c6522620c562d24031ad32187de83c3768df3c77
|
20
test/units/module_tests/TestDocker.py
Normal file
20
test/units/module_tests/TestDocker.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
import collections
|
||||
import mock
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from ansible.modules.core.cloud.docker.docker import get_split_image_tag
|
||||
|
||||
class DockerSplitImageTagTestCase(unittest.TestCase):
|
||||
|
||||
def test_trivial(self):
|
||||
self.assertEqual(get_split_image_tag('test'), ('test', 'latest'))
|
||||
|
||||
def test_with_org_name(self):
|
||||
self.assertEqual(get_split_image_tag('ansible/centos7-ansible'), ('ansible/centos7-ansible', 'latest'))
|
||||
|
||||
def test_with_tag(self):
|
||||
self.assertEqual(get_split_image_tag('test:devel'), ('test', 'devel'))
|
||||
|
||||
def test_with_tag_and_org_name(self):
|
||||
self.assertEqual(get_split_image_tag('ansible/centos7-ansible:devel'), ('ansible/centos7-ansible', 'devel'))
|
Loading…
Reference in a new issue