mirror of
https://github.com/containers/podman-compose.git
synced 2025-04-10 01:49:09 +02:00
tests/integration: Move test utils to one test_utils file
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
This commit is contained in:
parent
7d5bf645f6
commit
b685bce400
@ -7,8 +7,8 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
from tests.integration.test_utils import podman_compose_path
|
||||||
from tests.integration.test_podman_compose import test_path
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -5,8 +5,8 @@ import unittest
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
from tests.integration.test_utils import podman_compose_path
|
||||||
from tests.integration.test_podman_compose import test_path
|
from tests.integration.test_utils import test_path
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -5,9 +5,9 @@ import json
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
class TestBuildLabels(unittest.TestCase, RunSubprocessMixin):
|
class TestBuildLabels(unittest.TestCase, RunSubprocessMixin):
|
||||||
|
@ -7,8 +7,8 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
from tests.integration.test_utils import podman_compose_path
|
||||||
from tests.integration.test_podman_compose import test_path
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -9,9 +9,9 @@ import unittest
|
|||||||
from cryptography.hazmat.primitives import serialization
|
from cryptography.hazmat.primitives import serialization
|
||||||
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
|
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
expected_lines = [
|
expected_lines = [
|
||||||
"default: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFYQvN9a+toIB6jSs4zY7FMapZnHt80EKCUr/WhLwUum",
|
"default: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFYQvN9a+toIB6jSs4zY7FMapZnHt80EKCUr/WhLwUum",
|
||||||
|
@ -5,9 +5,9 @@ import unittest
|
|||||||
|
|
||||||
from parameterized import parameterized
|
from parameterized import parameterized
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path(scenario):
|
def compose_yaml_path(scenario):
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path(suffix=""):
|
def compose_yaml_path(suffix=""):
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_base_path():
|
def compose_base_path():
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -4,9 +4,9 @@ import os
|
|||||||
import unittest
|
import unittest
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -4,9 +4,9 @@ import os
|
|||||||
import unittest
|
import unittest
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
class TestFilesystem(unittest.TestCase, RunSubprocessMixin):
|
class TestFilesystem(unittest.TestCase, RunSubprocessMixin):
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -4,9 +4,9 @@ import json
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -6,9 +6,9 @@ import unittest
|
|||||||
|
|
||||||
from parameterized import parameterized
|
from parameterized import parameterized
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
class TestLifetime(unittest.TestCase, RunSubprocessMixin):
|
class TestLifetime(unittest.TestCase, RunSubprocessMixin):
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -5,9 +5,9 @@ import unittest
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -6,9 +6,9 @@ import unittest
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -6,9 +6,9 @@ import unittest
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -10,9 +10,9 @@ Tests the podman networking parameters
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
class TestPodmanComposeNetwork(RunSubprocessMixin, unittest.TestCase):
|
class TestPodmanComposeNetwork(RunSubprocessMixin, unittest.TestCase):
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
class TestPodmanComposeNetworkScopedAliases(RunSubprocessMixin, unittest.TestCase):
|
class TestPodmanComposeNetworkScopedAliases(RunSubprocessMixin, unittest.TestCase):
|
||||||
|
@ -10,9 +10,9 @@ Tests the podman compose up and down commands used to create and remove services
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
class TestPodmanCompose(unittest.TestCase, RunSubprocessMixin):
|
class TestPodmanCompose(unittest.TestCase, RunSubprocessMixin):
|
||||||
|
@ -12,9 +12,9 @@ import unittest
|
|||||||
|
|
||||||
from parameterized import parameterized
|
from parameterized import parameterized
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def profile_compose_file():
|
def profile_compose_file():
|
||||||
|
@ -12,9 +12,9 @@ import unittest
|
|||||||
|
|
||||||
from parameterized import parameterized
|
from parameterized import parameterized
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def profile_compose_file():
|
def profile_compose_file():
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0
|
|
||||||
|
|
||||||
import os
|
|
||||||
import unittest
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
|
|
||||||
def base_path():
|
|
||||||
"""Returns the base path for the project"""
|
|
||||||
return Path(__file__).parent.parent.parent
|
|
||||||
|
|
||||||
|
|
||||||
def test_path():
|
|
||||||
"""Returns the path to the tests directory"""
|
|
||||||
return os.path.join(base_path(), "tests/integration")
|
|
||||||
|
|
||||||
|
|
||||||
def podman_compose_path():
|
|
||||||
"""Returns the path to the podman compose script"""
|
|
||||||
return os.path.join(base_path(), "podman_compose.py")
|
|
@ -3,6 +3,22 @@
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
def base_path():
|
||||||
|
"""Returns the base path for the project"""
|
||||||
|
return Path(__file__).parent.parent.parent
|
||||||
|
|
||||||
|
|
||||||
|
def test_path():
|
||||||
|
"""Returns the path to the tests directory"""
|
||||||
|
return os.path.join(base_path(), "tests/integration")
|
||||||
|
|
||||||
|
|
||||||
|
def podman_compose_path():
|
||||||
|
"""Returns the path to the podman compose script"""
|
||||||
|
return os.path.join(base_path(), "podman_compose.py")
|
||||||
|
|
||||||
|
|
||||||
class RunSubprocessMixin:
|
class RunSubprocessMixin:
|
||||||
|
@ -7,8 +7,8 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
from tests.integration.test_utils import podman_compose_path
|
||||||
from tests.integration.test_podman_compose import test_path
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
def compose_yaml_path():
|
def compose_yaml_path():
|
||||||
|
@ -10,9 +10,9 @@ Tests the podman compose up and down commands used to create and remove services
|
|||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tests.integration.test_podman_compose import podman_compose_path
|
|
||||||
from tests.integration.test_podman_compose import test_path
|
|
||||||
from tests.integration.test_utils import RunSubprocessMixin
|
from tests.integration.test_utils import RunSubprocessMixin
|
||||||
|
from tests.integration.test_utils import podman_compose_path
|
||||||
|
from tests.integration.test_utils import test_path
|
||||||
|
|
||||||
|
|
||||||
class TestPodmanCompose(unittest.TestCase, RunSubprocessMixin):
|
class TestPodmanCompose(unittest.TestCase, RunSubprocessMixin):
|
||||||
|
Loading…
Reference in New Issue
Block a user