@@ -162,13 +162,15 @@ def test_get_quota():
162
162
163
163
def test_check_quota_Zero ():
164
164
self = create_autospec (ArcticLibraryBinding )
165
- self .quota = 0
165
+ self .get_library_metadata .return_value = 0
166
+ self .quota_countdown = 0
166
167
ArcticLibraryBinding .check_quota (self )
167
168
168
169
169
170
def test_check_quota_None ():
170
171
m = Mock (spec = ArcticLibraryBinding )
171
172
m .quota = None
173
+ m .quota_countdown = 0
172
174
m .get_library_metadata .return_value = None
173
175
ArcticLibraryBinding .check_quota (m )
174
176
m .get_library_metadata .assert_called_once_with ('QUOTA' )
@@ -178,6 +180,7 @@ def test_check_quota_None():
178
180
def test_check_quota_Zero2 ():
179
181
m = Mock (spec = ArcticLibraryBinding )
180
182
m .quota = None
183
+ m .quota_countdown = 0
181
184
m .get_library_metadata .return_value = 0
182
185
ArcticLibraryBinding .check_quota (m )
183
186
m .get_library_metadata .assert_called_once_with ('QUOTA' )
@@ -186,7 +189,7 @@ def test_check_quota_Zero2():
186
189
187
190
def test_check_quota_countdown ():
188
191
self = create_autospec (ArcticLibraryBinding )
189
- self .quota = 10
192
+ self .get_library_metadata . return_value = 10
190
193
self .quota_countdown = 10
191
194
ArcticLibraryBinding .check_quota (self )
192
195
assert self .quota_countdown == 9
@@ -195,7 +198,7 @@ def test_check_quota_countdown():
195
198
def test_check_quota ():
196
199
self = create_autospec (ArcticLibraryBinding )
197
200
self .arctic = create_autospec (Arctic )
198
- self .quota = 1024 * 1024 * 1024
201
+ self .get_library_metadata . return_value = 1024 * 1024 * 1024
199
202
self .quota_countdown = 0
200
203
self .arctic .__getitem__ .return_value = Mock (stats = Mock (return_value = {'totals' :
201
204
{'size' : 900 * 1024 * 1024 ,
@@ -212,7 +215,7 @@ def test_check_quota():
212
215
def test_check_quota_info ():
213
216
self = create_autospec (ArcticLibraryBinding )
214
217
self .arctic = create_autospec (Arctic )
215
- self .quota = 1024 * 1024 * 1024
218
+ self .get_library_metadata . return_value = 1024 * 1024 * 1024
216
219
self .quota_countdown = 0
217
220
self .arctic .__getitem__ .return_value = Mock (stats = Mock (return_value = {'totals' :
218
221
{'size' : 1 * 1024 * 1024 ,
@@ -229,7 +232,7 @@ def test_check_quota_info():
229
232
def test_check_quota_exceeded ():
230
233
self = create_autospec (ArcticLibraryBinding )
231
234
self .arctic = create_autospec (Arctic )
232
- self .quota = 1024 * 1024 * 1024
235
+ self .get_library_metadata . return_value = 1024 * 1024 * 1024
233
236
self .quota_countdown = 0
234
237
self .arctic .__getitem__ .return_value = Mock (stats = Mock (return_value = {'totals' :
235
238
{'size' : 1024 * 1024 * 1024 ,
0 commit comments