Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rv0lt committed Dec 9, 2024
1 parent c1ac699 commit 21103c2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def create_command_options_from_dict(options: typing.Dict) -> typing.List:
"safespring_secret": "newsafespringsecret",
"days_in_available": 45,
"days_in_expired": 15,
"quota": 80,
"quota": 0.8, # in TB
}


Expand Down Expand Up @@ -292,7 +292,7 @@ def test_create_new_unit_success(client, runner, capfd: LogCaptureFixture) -> No
assert new_unit.sto4_secret == correct_unit["safespring_secret"]
assert new_unit.days_in_available
assert new_unit.days_in_expired
assert new_unit.quota == correct_unit["quota"]
assert new_unit.quota == correct_unit["quota"] * 1000**4 # TB to bytes
assert new_unit.warning_level


Expand Down Expand Up @@ -502,7 +502,7 @@ def test_update_unit_quota_confirm_prompt_False(client, runner, capfd: LogCaptur
"--unit-id",
unit_id,
"--quota",
2, # 2 GB,
2, # 2 TB,
]

# Run command
Expand Down Expand Up @@ -541,7 +541,7 @@ def test_update_unit_quota_confirm_prompt_true(client, runner, capfd: LogCapture
"--unit-id",
unit_id,
"--quota",
2, # 2 GB,
2, # 2 TB,
]

# Run command
Expand All @@ -563,7 +563,7 @@ def test_update_unit_quota_confirm_prompt_true(client, runner, capfd: LogCapture
unit: models.Unit = models.Unit.query.filter_by(public_id=unit_id).first()
assert unit
assert unit.quota != quota_original
assert unit.quota == command_options[3] * 1000**3 # GB to bytes
assert unit.quota == command_options[3] * 1000**4 # TB to bytes


# update_uploaded_file_with_log
Expand Down

0 comments on commit 21103c2

Please sign in to comment.