Skip to content

Commit

Permalink
Code simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
apozsuse committed Sep 19, 2024
1 parent 2f5a2e8 commit 46e4d72
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions usr/share/lib/img_proof/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,16 @@ def f():

if suma_version and suma_version.startswith('4'):
# For suma 4.3 baseproduct HAS to be SUMA server
return all([
suma_server.exists,
suma_server.is_file,
base_product == suma_server_product
])
# For suma >=5 baseproduct has to be Micro
# SUMA is included as an additional product
sle_micro_product = '/etc/products.d/SLE-Micro.prod'
expected_product = suma_server_product
else:
# For suma >=5 baseproduct has to be Micro
# SUMA is included as an additional product
expected_product = '/etc/products.d/SLE-Micro.prod'

return all([
suma_server.exists,
suma_server.is_file,
base_product == sle_micro_product
base_product == expected_product
])
return f

Expand All @@ -182,18 +180,16 @@ def f():

if suma_version and suma_version.startswith('4'):
# For suma 4.3 baseproduct HAS to be SUMA proxy
return all([
suma_proxy.exists,
suma_proxy.is_file,
base_product == suma_proxy_product
])
# For suma >=5 baseproduct has to be Micro
# SUMA is included as an additional product
sle_micro_product = '/etc/products.d/SLE-Micro.prod'
expected_product = suma_proxy_product
else:
# For suma >=5 baseproduct has to be Micro
# SUMA is included as an additional product
expected_product = '/etc/products.d/SLE-Micro.prod'

return all([
suma_proxy.exists,
suma_proxy.is_file,
base_product == sle_micro_product
base_product == expected_product
])
return f

Expand Down

0 comments on commit 46e4d72

Please sign in to comment.