Fix #570: Exclude in-place imported files from quota computation

This commit is contained in:
Eliot Berriot 2019-03-21 10:32:12 +01:00
parent 97ef15906d
commit cc71d2bb20
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 39 additions and 3 deletions

View file

@ -53,7 +53,25 @@ def test_actor_get_quota(factories):
audio_file__from_path=None,
audio_file__data=b"aaaa",
)
expected = {"total": 10, "pending": 1, "skipped": 2, "errored": 3, "finished": 4}
# this one is imported in place and don't count
factories["music.Upload"](
library=library,
import_status="finished",
source="file://test",
audio_file=None,
size=42,
)
# this one is imported in place but count because there is a mapped file
factories["music.Upload"](
library=library,
import_status="finished",
source="file://test2",
audio_file__from_path=None,
audio_file__data=b"aaaa",
)
expected = {"total": 14, "pending": 1, "skipped": 2, "errored": 3, "finished": 8}
assert library.actor.get_current_usage() == expected