| |
@@ -80,7 +80,11 @@
|
| |
message = MagicMock()
|
| |
message.body = {"commit": {"stats": {"files": {}}}}
|
| |
config = MagicMock()
|
| |
- config = {"koji_url": "https://example.koji.org"}
|
| |
+ config = {
|
| |
+ "koji_url": "https://example.koji.org",
|
| |
+ "principal": "principal",
|
| |
+ "keytab": "keytab",
|
| |
+ }
|
| |
self.toddler_cls.process_block_retired(config, message)
|
| |
assert caplog.records[-1].message == "No dead.package in the commit, bailing"
|
| |
|
| |
@@ -96,7 +100,11 @@
|
| |
}
|
| |
}
|
| |
config = MagicMock()
|
| |
- config = {"koji_url": "https://example.koji.org"}
|
| |
+ config = {
|
| |
+ "koji_url": "https://example.koji.org",
|
| |
+ "principal": "principal",
|
| |
+ "keytab": "keytab",
|
| |
+ }
|
| |
self.toddler_cls.process_block_retired(config, message)
|
| |
assert caplog.records[-1].message == "dead.package file was not added, bailing"
|
| |
|
| |
@@ -116,7 +124,11 @@
|
| |
}
|
| |
}
|
| |
config = MagicMock()
|
| |
- config = {"koji_url": "https://example.koji.org"}
|
| |
+ config = {
|
| |
+ "koji_url": "https://example.koji.org",
|
| |
+ "principal": "principal",
|
| |
+ "keytab": "keytab",
|
| |
+ }
|
| |
self.toddler_cls.process_block_retired(config, message)
|
| |
self.toddler_cls.koji_session.packageListBlock.assert_called_once_with(
|
| |
taginfo="f41",
|
| |
@@ -138,7 +150,11 @@
|
| |
}
|
| |
}
|
| |
config = MagicMock()
|
| |
- config = {"koji_url": "https://example.koji.org"}
|
| |
+ config = {
|
| |
+ "koji_url": "https://example.koji.org",
|
| |
+ "principal": "principal",
|
| |
+ "keytab": "keytab",
|
| |
+ }
|
| |
self.toddler_cls.process_block_retired(config, message)
|
| |
self.toddler_cls.koji_session.packageListBlock.assert_called_once_with(
|
| |
taginfo="f38",
|
| |
@@ -159,12 +175,15 @@
|
| |
}
|
| |
}
|
| |
config = MagicMock()
|
| |
- config = {"koji_url": "https://example.koji.org"}
|
| |
+ config = {
|
| |
+ "koji_url": "https://example.koji.org",
|
| |
+ "principal": "principal",
|
| |
+ "keytab": "keytab",
|
| |
+ }
|
| |
self.toddler_cls.koji_session.packageListBlock.side_effect = koji.GenericError(
|
| |
"Failed"
|
| |
)
|
| |
- with pytest.raises(koji.GenericError):
|
| |
- self.toddler_cls.process_block_retired(config, message)
|
| |
+ self.toddler_cls.process_block_retired(config, message)
|
| |
assert (
|
| |
caplog.records[-1].message
|
| |
== "Failed to block retired package example-repo on branch f38: Failed"
|
| |
@@ -184,12 +203,15 @@
|
| |
}
|
| |
}
|
| |
config = MagicMock()
|
| |
- config = {"koji_url": "https://example.stg.koji.org"}
|
| |
+ config = {
|
| |
+ "koji_url": "https://example.koji.org",
|
| |
+ "principal": "principal",
|
| |
+ "keytab": "keytab",
|
| |
+ }
|
| |
self.toddler_cls.koji_session.packageListBlock.side_effect = koji.GenericError(
|
| |
"Failed"
|
| |
)
|
| |
- with pytest.raises(koji.GenericError):
|
| |
- self.toddler_cls.process_block_retired(config, message)
|
| |
+ self.toddler_cls.process_block_retired(config, message)
|
| |
assert (
|
| |
caplog.records[-1].message
|
| |
== "Failed to block retired package example-epel-repo on branch f38: Failed"
|
| |
koji_block_retired toddler related changes, tested on staging and the last commit fixes the failing tests (adds mock for get_rawhide_tag function)