2022-01-18 14:54:14 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
|
2023-06-15 13:11:30 +00:00
|
|
|
import docker_server as ds
|
2024-09-27 10:19:39 +00:00
|
|
|
from version_helper import get_version_from_string
|
2022-03-30 22:15:01 +00:00
|
|
|
|
2022-01-18 14:54:14 +00:00
|
|
|
|
2022-03-30 22:15:01 +00:00
|
|
|
class TestDockerServer(unittest.TestCase):
|
|
|
|
def test_gen_tags(self):
|
2022-04-01 15:53:43 +00:00
|
|
|
version = get_version_from_string("22.2.2.2")
|
2022-03-30 22:15:01 +00:00
|
|
|
cases = (
|
2024-08-02 07:23:40 +00:00
|
|
|
("release-latest", ["latest", "22", "22.2", "22.2.2", "22.2.2.2"]),
|
|
|
|
("release", ["22", "22.2", "22.2.2", "22.2.2.2"]),
|
2022-04-01 15:53:43 +00:00
|
|
|
("head", ["head"]),
|
2022-03-30 22:15:01 +00:00
|
|
|
)
|
|
|
|
for case in cases:
|
2022-04-01 15:53:43 +00:00
|
|
|
release_type = case[0]
|
2022-03-30 22:15:01 +00:00
|
|
|
self.assertEqual(case[1], ds.gen_tags(version, release_type))
|