2016-04-27 16:23:31 +02:00
|
|
|
import collections
|
|
|
|
import os
|
|
|
|
import unittest
|
|
|
|
|
2016-06-11 18:14:54 +02:00
|
|
|
from ansible.modules.core.cloud.docker.docker import get_split_image_tag
|
2016-04-27 16:23:31 +02:00
|
|
|
|
|
|
|
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'))
|