Fix minor Ruff/flake8 warnings

```
pungi/checks.py:575:17: F601 [*] Dictionary key literal `"type"` repeated
pungi/phases/pkgset/pkgsets.py:617:12: E721 Do not compare types, use `isinstance()`
tests/test_pkgset_source_koji.py:241:16: E721 Do not compare types, use `isinstance()`
tests/test_pkgset_source_koji.py:244:16: E721 Do not compare types, use `isinstance()`
tests/test_pkgset_source_koji.py:370:16: E721 Do not compare types, use `isinstance()`
tests/test_pkgset_source_koji.py:374:20: E721 Do not compare types, use `isinstance()`
```

Signed-off-by: Timothée Ravier <tim@siosm.fr>
This commit is contained in:
Timothée Ravier 2023-10-03 13:28:20 +00:00
parent f30a8b4d15
commit 2534ddee99
3 changed files with 5 additions and 6 deletions

View File

@ -572,7 +572,6 @@ def make_schema():
}, },
"required": ["kickstart"], "required": ["kickstart"],
"additionalProperties": False, "additionalProperties": False,
"type": "object",
}, },
"osbs_config": { "osbs_config": {
"type": "object", "type": "object",

View File

@ -614,7 +614,7 @@ class KojiPackageSet(PackageSetBase):
result_srpms = [] result_srpms = []
include_packages = set(include_packages or []) include_packages = set(include_packages or [])
if type(event) is dict: if isinstance(event, dict):
event = event["id"] event = event["id"]
msg = "Getting latest RPMs (tag: %s, event: %s, inherit: %s)" % ( msg = "Getting latest RPMs (tag: %s, event: %s, inherit: %s)" % (

View File

@ -238,10 +238,10 @@ class TestGetPackageSetFromKoji(helpers.PungiTestCase):
self.compose, self.koji_wrapper, event, module_info_str self.compose, self.koji_wrapper, event, module_info_str
) )
assert type(result) is list assert isinstance(result, list)
assert len(result) == 1 assert len(result) == 1
module = result[0] module = result[0]
assert type(module) is dict assert isinstance(module, dict)
self.assertIn("module_stream", module) self.assertIn("module_stream", module)
self.assertIn("module_version", module) self.assertIn("module_version", module)
self.assertIn("module_context", module) self.assertIn("module_context", module)
@ -367,11 +367,11 @@ class TestGetPackageSetFromKoji(helpers.PungiTestCase):
self.compose, self.koji_wrapper, event, module_info_str self.compose, self.koji_wrapper, event, module_info_str
) )
assert type(result) is list assert isinstance(result, list)
assert len(result) == 2 assert len(result) == 2
module = result[0] module = result[0]
for module in result: for module in result:
assert type(module) is dict assert isinstance(module, dict)
self.assertIn("module_stream", module) self.assertIn("module_stream", module)
self.assertIn("module_version", module) self.assertIn("module_version", module)
self.assertIn("module_context", module) self.assertIn("module_context", module)