Skip to content

Commit

Permalink
Add tests for checking the censorship
Browse files Browse the repository at this point in the history
Signed-off-by: Akashdeep Dhar <[email protected]>
  • Loading branch information
gridhead committed Nov 19, 2023
1 parent 0eb681e commit a39483a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

from pagure_exporter.conf import standard
from pagure_exporter.main import main
from pagure_exporter.view.dcrt import conceal


@pytest.mark.parametrize(
Expand Down Expand Up @@ -142,6 +143,22 @@
],
id="Migrating repository contents with specifying four invalid branch names",
),
pytest.param(
f"--srce {envr['TEST_SRCE']} --dest {envr['TEST_DEST']} --pkey {envr['TEST_PKEY']} --gkey {envr['TEST_GKEY']} --fusr {envr['TEST_FUSR']} --tusr {envr['TEST_TUSR']} repo", # noqa: E501
0,
[
f"Address: https://{envr['TEST_FUSR']}:{conceal(envr['TEST_PKEY'])}@pagure.io/{envr['TEST_SRCE']}.git", # noqa: E501
],
id="Checking the correctness of metadata censorship for source namespace",
),
pytest.param(
f"--srce {envr['TEST_SRCE']} --dest {envr['TEST_DEST']} --pkey {envr['TEST_PKEY']} --gkey {envr['TEST_GKEY']} --fusr {envr['TEST_FUSR']} --tusr {envr['TEST_TUSR']} repo", # noqa: E501
0,
[
f"Address: https://{envr['TEST_TUSR']}:{conceal(envr['TEST_GKEY'])}@gitlab.com/{envr['TEST_TUSR']}", # noqa: E501
],
id="Checking the correctness of metadata censorship for destination namespace",
),
],
)
def test_main_repo(caplog, cmdl, code, text):
Expand Down

0 comments on commit a39483a

Please sign in to comment.