Skip to content

Commit

Permalink
Add test for user-provided storage in disk usage calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Dec 13, 2024
1 parent 1a91049 commit be4fea5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/unit/data/test_quota.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,21 @@ def test_calculate_usage(self):

assert u.calculate_disk_usage_default_source(object_store) == 10

def test_calculate_usage_with_user_provided_storage(self):
u = self.u

self._add_dataset(10)
# This dataset should not be counted towards the user's disk usage
self._add_dataset(30, object_store_id="user_objects://private/user/storage")

object_store = MockObjectStore()
assert u.calculate_disk_usage_default_source(object_store) == 10
assert u.disk_usage is None
u.calculate_and_set_disk_usage(object_store)
assert u.calculate_disk_usage_default_source(object_store) == 10

self._refresh_user_and_assert_disk_usage_is(10)

def test_calculate_usage_readjusts_incorrect_quota(self):
u = self.u

Expand Down

0 comments on commit be4fea5

Please sign in to comment.