The problem was found in
test_not_allow_to_build_if_gating_yaml_is_invalid originally, which does
not have objects mocked properly, that causes expected error is not
raised.
This patch fixes tests relative to gating.yaml validation by having
object mocked correctly and mocking request.post to cover more code
path to ensure the code works as expected.
Additionally, a new config file is added to fixtures directory which has
rpkg.greenwave section added for testing gating.yaml validation
specifically. And, test case TestBuildPackage is updated to create test
repositories only once to make tests faster.
The problem was found in
test_not_allow_to_build_if_gating_yaml_is_invalid originally, which does
not have objects mocked properly, that causes expected error is not
raised.
This patch fixes tests relative to gating.yaml validation by having
object mocked correctly and mocking request.post to cover more code
path to ensure the code works as expected.
Additionally, a new config file is added to fixtures directory which has
rpkg.greenwave section added for testing gating.yaml validation
specifically. And, test case TestBuildPackage is updated to create test
repositories only once to make tests faster.
Signed-off-by: Chenxiong Qi cqi@redhat.com