forked from rpm-software-management/ci-dnf-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransaction-test.feature
More file actions
68 lines (55 loc) · 2.16 KB
/
transaction-test.feature
File metadata and controls
68 lines (55 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Feature: transaction: dry-run a transaction
Background:
Given I use repository "simple-base"
@bz2109660
Scenario: Test labirinto install transaction when it should succeed
When I execute python libdnf5 api script with setup
"""
goal = libdnf5.base.Goal(base)
goal.add_rpm_install("labirinto")
assert test_transaction(goal) == libdnf5.base.Transaction.TransactionRunResult_SUCCESS
"""
Then the exit code is 0
And stderr is empty
@bz2109660
Scenario: Test labirinto install transaction when it should fail
When I execute python libdnf5 api script with setup
"""
goal = libdnf5.base.Goal(base)
goal.add_rpm_install("labirinto")
execute_transaction(goal, "install a package")
# We have already run the transaction, so test_transaction should return a failing status
assert test_transaction(goal) == libdnf5.base.Transaction.TransactionRunResult_ERROR_RPM_RUN
"""
Then the exit code is 0
And stderr is empty
Scenario: Test transaction that removes not installed labirinto package
When I execute python libdnf5 api script with setup
"""
goal = libdnf5.base.Goal(base)
goal.add_rpm_remove("labirinto")
# it is supposed to be OK
assert test_transaction(goal) == libdnf5.base.Transaction.TransactionRunResult_SUCCESS
"""
Then the exit code is 0
And stderr is empty
Scenario: Test transaction installing labirinto and a non-existent package
When I execute python libdnf5 api script with setup
"""
goal = libdnf5.base.Goal(base)
goal.add_rpm_install("non-existent-install")
goal.add_rpm_install("labirinto")
assert test_transaction(goal) == libdnf5.base.Transaction.TransactionRunResult_ERROR_RESOLVE
"""
Then the exit code is 0
And stderr is empty
Scenario: Test transaction containing improper argument
When I execute python libdnf5 api script with setup
"""
goal = libdnf5.base.Goal(base)
goal.add_rpm_install(99)
# traceback is expected
test_transaction(goal)
"""
Then the exit code is 1
And stderr contains "TypeError: Wrong number or type of arguments for overloaded function 'Goal_add_rpm_install'."