Skip to content

Commit ffaa87b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d15f636 commit ffaa87b

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

src/pushsource/_impl/model/productid.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ class Product(object):
4242
:type: List[str]
4343
"""
4444

45-
provided_tags = attr.ib(type=list, default=None, converter=convert_maybe(sloppylist))
45+
provided_tags = attr.ib(
46+
type=list, default=None, converter=convert_maybe(sloppylist)
47+
)
4648
"""List of tags describing the provided platforms used for pairing with other products.
4749
4850
:type: List[str]
@@ -90,19 +92,21 @@ def _load_products(self, path):
9092
# 3 = Product Architecture, e.g. "s390x"
9193
# 4 = Product Tags / Provides, e.g. "rhel-9,rhel-9-s390x"
9294
eng_id, attribute_id = map(int, oid.split(".")[9:11])
93-
products_data[eng_id][attribute_id] = str(decoder.decode(extension.value.value)[0])
95+
products_data[eng_id][attribute_id] = str(
96+
decoder.decode(extension.value.value)[0]
97+
)
9498

9599
if not products_data:
96100
raise ValueError("File is not a ProductID certificate.")
97101

98102
result = []
99103
for eng_id, product_data in products_data.items():
100104
product = Product(
101-
id = eng_id,
102-
name = product_data.get(1),
103-
version = product_data.get(2),
104-
architecture = product_data.get(3),
105-
provided_tags = product_data.get(4),
105+
id=eng_id,
106+
name=product_data.get(1),
107+
version=product_data.get(2),
108+
architecture=product_data.get(3),
109+
provided_tags=product_data.get(4),
106110
)
107111
result.append(product)
108112
return result

tests/model/test_productid.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
THIS_DIR = os.path.dirname(__file__)
88
CASE_DIR = os.path.join(THIS_DIR, "cases")
99

10+
1011
def test_invalid_productid():
1112
with raises(ValueError) as ex:
12-
_ = ProductIdPushItem(name="foo", src=os.path.join(CASE_DIR, "invalid-productid.pem"))
13+
_ = ProductIdPushItem(
14+
name="foo", src=os.path.join(CASE_DIR, "invalid-productid.pem")
15+
)
1316

1417
assert "File is not a ProductID certificate." in str(ex.value)

0 commit comments

Comments
 (0)