Commit 17f234f0 by Guba Sándor

storage: test

parent 2654f523
......@@ -2,7 +2,7 @@ from datetime import timedelta
from django.test import TestCase
from django.utils import timezone
from mock import MagicMock
from mock import MagicMock, Mock
from ..models import Disk, DataStore
......@@ -81,3 +81,8 @@ class DiskTestCase(TestCase):
d.ready = False
with self.assertRaises(MockException):
Disk.save_as(d)
def test_download_percentage_no_download(self):
d = MagicMock(spec=Disk)
d.is_downloading = Mock(return_value=False)
assert Disk.get_download_percentage(d) is None
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment