more options in setup command

This commit is contained in:
2021-04-04 15:42:06 +03:00
parent 56c600e5ac
commit ffe6aec190
12 changed files with 75 additions and 47 deletions

View File

@ -9,7 +9,7 @@ def test_repository_sign_args_1(gpg_with_key: GPG) -> None:
"""
must generate correct sign args
"""
gpg_with_key.targets = {SignSettings.SignRepository}
gpg_with_key.targets = {SignSettings.Repository}
assert gpg_with_key.repository_sign_args
@ -17,7 +17,7 @@ def test_repository_sign_args_2(gpg_with_key: GPG) -> None:
"""
must generate correct sign args
"""
gpg_with_key.targets = {SignSettings.SignPackages, SignSettings.SignRepository}
gpg_with_key.targets = {SignSettings.Packages, SignSettings.Repository}
assert gpg_with_key.repository_sign_args
@ -33,7 +33,7 @@ def test_repository_sign_args_skip_2(gpg_with_key: GPG) -> None:
"""
must return empty args if it is not set
"""
gpg_with_key.targets = {SignSettings.SignPackages}
gpg_with_key.targets = {SignSettings.Packages}
assert not gpg_with_key.repository_sign_args
@ -41,7 +41,7 @@ def test_repository_sign_args_skip_3(gpg: GPG) -> None:
"""
must return empty args if it is not set
"""
gpg.targets = {SignSettings.SignRepository}
gpg.targets = {SignSettings.Repository}
assert not gpg.repository_sign_args
@ -49,7 +49,7 @@ def test_repository_sign_args_skip_4(gpg: GPG) -> None:
"""
must return empty args if it is not set
"""
gpg.targets = {SignSettings.SignPackages, SignSettings.SignRepository}
gpg.targets = {SignSettings.Packages, SignSettings.Repository}
assert not gpg.repository_sign_args
@ -78,7 +78,7 @@ def test_sign_package_1(gpg_with_key: GPG, mocker: MockerFixture) -> None:
result = [Path("a"), Path("a.sig")]
process_mock = mocker.patch("ahriman.core.sign.gpg.GPG.process", return_value=result)
gpg_with_key.targets = {SignSettings.SignPackages}
gpg_with_key.targets = {SignSettings.Packages}
assert gpg_with_key.sign_package(Path("a"), "a") == result
process_mock.assert_called_once()
@ -90,7 +90,7 @@ def test_sign_package_2(gpg_with_key: GPG, mocker: MockerFixture) -> None:
result = [Path("a"), Path("a.sig")]
process_mock = mocker.patch("ahriman.core.sign.gpg.GPG.process", return_value=result)
gpg_with_key.targets = {SignSettings.SignPackages, SignSettings.SignRepository}
gpg_with_key.targets = {SignSettings.Packages, SignSettings.Repository}
assert gpg_with_key.sign_package(Path("a"), "a") == result
process_mock.assert_called_once()
@ -110,7 +110,7 @@ def test_sign_package_skip_2(gpg_with_key: GPG, mocker: MockerFixture) -> None:
must not sign package if it is not set
"""
process_mock = mocker.patch("ahriman.core.sign.gpg.GPG.process")
gpg_with_key.targets = {SignSettings.SignRepository}
gpg_with_key.targets = {SignSettings.Repository}
gpg_with_key.sign_package(Path("a"), "a")
process_mock.assert_not_called()
@ -120,7 +120,7 @@ def test_sign_package_skip_3(gpg: GPG, mocker: MockerFixture) -> None:
must not sign package if it is not set
"""
process_mock = mocker.patch("ahriman.core.sign.gpg.GPG.process")
gpg.targets = {SignSettings.SignPackages}
gpg.targets = {SignSettings.Packages}
gpg.sign_package(Path("a"), "a")
process_mock.assert_not_called()
@ -130,7 +130,7 @@ def test_sign_package_skip_4(gpg: GPG, mocker: MockerFixture) -> None:
must not sign package if it is not set
"""
process_mock = mocker.patch("ahriman.core.sign.gpg.GPG.process")
gpg.targets = {SignSettings.SignPackages, SignSettings.SignRepository}
gpg.targets = {SignSettings.Packages, SignSettings.Repository}
gpg.sign_package(Path("a"), "a")
process_mock.assert_not_called()
@ -142,7 +142,7 @@ def test_sign_repository_1(gpg_with_key: GPG, mocker: MockerFixture) -> None:
result = [Path("a"), Path("a.sig")]
process_mock = mocker.patch("ahriman.core.sign.gpg.GPG.process", return_value=result)
gpg_with_key.targets = {SignSettings.SignRepository}
gpg_with_key.targets = {SignSettings.Repository}
assert gpg_with_key.sign_repository(Path("a")) == result
process_mock.assert_called_once()
@ -154,7 +154,7 @@ def test_sign_repository_2(gpg_with_key: GPG, mocker: MockerFixture) -> None:
result = [Path("a"), Path("a.sig")]
process_mock = mocker.patch("ahriman.core.sign.gpg.GPG.process", return_value=result)
gpg_with_key.targets = {SignSettings.SignPackages, SignSettings.SignRepository}
gpg_with_key.targets = {SignSettings.Packages, SignSettings.Repository}
assert gpg_with_key.sign_repository(Path("a")) == result
process_mock.assert_called_once()
@ -174,7 +174,7 @@ def test_sign_repository_skip_2(gpg_with_key: GPG, mocker: MockerFixture) -> Non
must not sign repository if it is not set
"""
process_mock = mocker.patch("ahriman.core.sign.gpg.GPG.process")
gpg_with_key.targets = {SignSettings.SignPackages}
gpg_with_key.targets = {SignSettings.Packages}
gpg_with_key.sign_repository(Path("a"))
process_mock.assert_not_called()
@ -184,7 +184,7 @@ def test_sign_repository_skip_3(gpg: GPG, mocker: MockerFixture) -> None:
must not sign repository if it is not set
"""
process_mock = mocker.patch("ahriman.core.sign.gpg.GPG.process")
gpg.targets = {SignSettings.SignRepository}
gpg.targets = {SignSettings.Repository}
gpg.sign_repository(Path("a"))
process_mock.assert_not_called()
@ -194,6 +194,6 @@ def test_sign_repository_skip_4(gpg: GPG, mocker: MockerFixture) -> None:
must not sign repository if it is not set
"""
process_mock = mocker.patch("ahriman.core.sign.gpg.GPG.process")
gpg.targets = {SignSettings.SignPackages, SignSettings.SignRepository}
gpg.targets = {SignSettings.Packages, SignSettings.Repository}
gpg.sign_repository(Path("a"))
process_mock.assert_not_called()