mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 04:02:32 +01:00
fix tests & syntax for older Python versions
This commit is contained in:
parent
0bbdeaaa50
commit
01e8433889
@ -580,6 +580,7 @@ class CustomNone():
|
||||
def __len__():
|
||||
return 0
|
||||
|
||||
__int__ = __len__
|
||||
__hash__ = __len__
|
||||
__index__ = __len__
|
||||
|
||||
|
@ -16,6 +16,7 @@ import time
|
||||
import random
|
||||
import string
|
||||
import datetime
|
||||
import platform
|
||||
import tempfile
|
||||
import itertools
|
||||
import http.cookiejar
|
||||
@ -769,7 +770,7 @@ def hash(value):
|
||||
self.assertEqual(obj + 123, obj)
|
||||
self.assertEqual(obj - 123, obj)
|
||||
self.assertEqual(obj * 123, obj)
|
||||
self.assertEqual(obj @ 123, obj)
|
||||
# self.assertEqual(obj @ 123, obj)
|
||||
self.assertEqual(obj / 123, obj)
|
||||
self.assertEqual(obj // 123, obj)
|
||||
self.assertEqual(obj % 123, obj)
|
||||
@ -777,7 +778,7 @@ def hash(value):
|
||||
self.assertEqual(123 + obj, obj)
|
||||
self.assertEqual(123 - obj, obj)
|
||||
self.assertEqual(123 * obj, obj)
|
||||
self.assertEqual(123 @ obj, obj)
|
||||
# self.assertEqual(123 @ obj, obj)
|
||||
self.assertEqual(123 / obj, obj)
|
||||
self.assertEqual(123 // obj, obj)
|
||||
self.assertEqual(123 % obj, obj)
|
||||
@ -807,6 +808,7 @@ def hash(value):
|
||||
array = [1, 2, 3]
|
||||
self.assertEqual(array[obj], 1)
|
||||
|
||||
if platform.python_implementation().lower() == "cpython":
|
||||
self.assertTrue(time.localtime(obj))
|
||||
|
||||
i = 0
|
||||
|
Loading…
Reference in New Issue
Block a user