8000 Fix tests & Add new files structure test category by matiboux · Pull Request #94 · matiboux/dockerc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix tests & Add new files structure test category #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
50 changes: 50 additions & 0 deletions test/test/structure_1_33_00/test_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from test.src.format_dockerc_stdout import format_dockerc_stdout
from test.src.TestDirContext import TestDirContext

def test_base(file = __file__):
with TestDirContext(file) as ctx:
dockerc = ctx.run_dockerc(
'base',
)
dockerc.assert_context_ok(
format_dockerc_stdout(
b'docker compose'
b' -f ./docker-compose-base.yml'
b' up -d'
),
)

def test_base_override(file = __file__):
with TestDirContext(file) as ctx:
dockerc = ctx.run_dockerc(
'base.override',
)
dockerc.assert_context_ok(
format_dockerc_stdout(
b'docker compose'
b' -f ./docker-compose-base.yml'
b' -f ./docker-compose-base.override.yml'
b' up -d'
),
)

def test_base_dev(file = __file__):
with TestDirContext(file) as ctx:
dockerc = ctx.run_dockerc(
'base.dev',
)
dockerc.assert_context_not_found()

def test_base_prod_not_found(file = __file__):
with TestDirContext(file) as ctx:
dockerc = ctx.run_dockerc(
'base.prod',
)
dockerc.assert_context_not_found()

def test_base_what_not_found(file = __file__):
with TestDirContext(file) as ctx:
dockerc = ctx.run_dockerc(
'base.what',
)
dockerc.assert_context_not_found()
62 changes: 62 additions & 0 deletions test/test/structure_1_33_00/test_standard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
from test.src.format_dockerc_stdout import format_dockerc_stdout
from test.src.TestDirContext import TestDirContext

def test_default(file = __file__):
with TestDirContext(file) as ctx:
dockerc = ctx.run_dockerc()
dockerc.assert_context_ok(
format_dockerc_stdout(
b'docker compose'
b' -f ./docker-compose.yml'
b' -f ./docker-compose.override.yml'
b' up -d'
),
)

def test_override_not_found(file = __file__):
with TestDirContext(file) as ctx:
dockerc = ctx.run_dockerc(
'override',
)
dockerc.assert_context_ok(
format_dockerc_stdout(
b'docker compose'
b' -f ./docker-compose.yml'
b' -f ./docker-compose.override.yml'
b' up -d'
),
)

def test_dev_not_found(file = __file__):
with TestDirContext(file) as ctx:
dockerc = ctx.run_dockerc(
'dev',
)
dockerc.assert_context_ok(
format_dockerc_stdout(
b'docker compose'
b' -f ./docker-compose.yml'
b' -f ./docker-compose.dev.yml'
b' up -d'
),
)

def test_prod_not_found(file = __file__):
with TestDirContext(file) as ctx:
dockerc = ctx.run_dockerc(
'prod',
)
dockerc.assert_context_ok(
format_dockerc_stdout(
b'docker compose'
b' -f ./docker-compose.yml'
b' up -d'
),
)

def test_what_not_found(file = __file__):
with TestDirContext(file) as ctx:
dockerc = ctx.run_dockerc(
'what',
)
dockerc.assert_context_not_found()
0