Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Bondarenko <[email protected]>
  • Loading branch information
ebondare committed Nov 19, 2024
1 parent b67f73b commit 6c72756
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/functional/ui/test_provider_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ class TestOnboardingTokenGenerationWithQuota(ManageTest):
Test onboarding token generation when quota is specified
"""

def test_token_generation_with_quota(self, quota_value=2, quota_tib=True):
def test_token_generation_with_quota(
self, setup_ui_class, quota_value=2, quota_tib=True
):
storage_clients = PageNavigator().nav_to_storageclients_page()
token = storage_clients.generate_client_onboarding_ticket(
quota_value=quota_value, quota_tib=quota_tib
)
logger.info(f"Token generated. It begins with {token[:20]}")
assert len(token) > 20, "Token is too short"

def test_quota_decrease_blocked(self):
def test_quota_decrease_blocked(self, setup_ui_class):
"""
Test that quota cannot be increased for a client:
if a client has unlimited quota, it cannot be changed.
Expand All @@ -59,7 +61,7 @@ def test_quota_decrease_blocked(self):
new_value=new_quota,
)

def test_quota_increase(self):
def test_quota_increase(self, setup_ui_class):
"""
Test that quota can be increased in the UI for every client with limited quota
both by manually setting a new value and by clicking Increment
Expand All @@ -80,7 +82,7 @@ def test_quota_increase(self):
client_cluster_name=client, increase_by_one=True
)

def test_available_capacity_in_quota_edit_popup(self):
def test_available_capacity_in_quota_edit_popup(self, setup_ui_class):
"""
Test that Quota edit popup shows correct value of
Available capacity
Expand All @@ -95,7 +97,7 @@ def test_available_capacity_in_quota_edit_popup(self):
ceph_capacity_tib = ceph_capacity_bytes / 2**40
assert (ui_capacity_num - ceph_capacity_tib) ** 2 < 0.1

def test_quota_values_in_ui(self):
def test_quota_values_in_ui(self, setup_ui_class):
"""
Test that all storage clients have correct quota value in the UI
"""
Expand Down

0 comments on commit 6c72756

Please sign in to comment.