def test_update_and_stop_seeding_that_seeding_return_none(self, mock_get_torrent, mock_hset):
mock_get_torrent.return_value = self.torrent(
status='seeding',
progress=Decimal('100.00'),
ratio=Decimal('9.99'),
rateUpload=10500,
rateDownload=105000,
stop=mock_stop
)
self.torrent_model.created = timezone.now() + timezone.timedelta(hours=-24, seconds=-1)
self.torrent_model.save()
self.assertIsNone(update_and_stop_seeding(self.torrent_model.pk))
mock_get_torrent.assert_called_with(self.torrent_model.hash)
mock_hset.assert_called_with('torrent:{}'.format(self.torrent_model.pk), 'rate_upload', 0)
评论列表
文章目录