mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-05-12 19:07:12 +08:00
Fix tests in order to run with PostgreSQL
Most of the issues are caused by the use of SQLAlchemy database session. Some inline comments describe the issues in detail. Signed-off-by: Chenxiong Qi <cqi@redhat.com>
This commit is contained in:
@@ -121,10 +121,11 @@ class TestDecisionUpdateHandler:
|
||||
clean_database()
|
||||
|
||||
# This build should be queried and transformed to ready state
|
||||
module_build = make_module("pkg:0.1:1:c1", requires_list={"platform": "el8"})
|
||||
module_build = make_module(db.session, "pkg:0.1:1:c1", requires_list={"platform": "el8"})
|
||||
module_build.transition(
|
||||
conf, BUILD_STATES["done"], "Move to done directly for running test."
|
||||
)
|
||||
db.session.commit()
|
||||
|
||||
# Assert this call below
|
||||
first_publish_call = call(
|
||||
@@ -134,8 +135,6 @@ class TestDecisionUpdateHandler:
|
||||
conf=conf,
|
||||
)
|
||||
|
||||
db.session.refresh(module_build)
|
||||
|
||||
ClientSession.return_value.getBuild.return_value = {
|
||||
"extra": {"typeinfo": {"module": {"module_build_service_id": module_build.id}}}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user