mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-06 01:01:32 -07:00
Some algorithmic unittests for the apt and docker modules
This commit is contained in:
parent
13532027ff
commit
7e1fbe2e03
4 changed files with 69 additions and 0 deletions
19
test/units/modules/core/test_docker.py
Normal file
19
test/units/modules/core/test_docker.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
import collections
|
||||
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…
Add table
Add a link
Reference in a new issue