Skip to content

Commit

Permalink
tests/integration: Move test utils to one test_utils file
Browse files Browse the repository at this point in the history
Signed-off-by: Monika Kairaityte <[email protected]>
  • Loading branch information
mokibit committed Jan 22, 2025
1 parent 7c1cfa8 commit a4c2ecc
Show file tree
Hide file tree
Showing 32 changed files with 78 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import subprocess
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 podman_compose_path
from tests.integration.test_utils import test_path


def compose_yaml_path():
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/build/test_podman_compose_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/build_labels/test_build_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import subprocess
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 podman_compose_path
from tests.integration.test_utils import test_path


def compose_yaml_path():
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/build_ssh/test_build_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from cryptography.hazmat.primitives import serialization
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin

expected_lines = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/deps/test_podman_compose_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/env-tests/test_podman_compose_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/exit-from/test_podman_compose_exit_from.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/extends/test_podman_compose_extends.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import unittest
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import unittest
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/lifetime/test_lifetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/nethost/test_podman_compose_nethost.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/network/test_podman_compose_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/ports/test_podman_compose_ports.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/profile/test_podman_compose_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/profile/test_podman_compose_up_down.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down
20 changes: 0 additions & 20 deletions tests/integration/test_podman_compose.py

This file was deleted.

18 changes: 18 additions & 0 deletions tests/integration/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
import os
import subprocess
import time
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")


class RunSubprocessMixin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import subprocess
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 podman_compose_path
from tests.integration.test_utils import test_path


def compose_yaml_path():
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/vol/test_podman_compose_vol.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import os
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 podman_compose_path
from tests.integration.test_utils import test_path
from tests.integration.test_utils import RunSubprocessMixin


Expand Down

0 comments on commit a4c2ecc

Please sign in to comment.