1
0
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:
Mike Fährmann 2024-08-15 18:16:55 +02:00
parent 0bbdeaaa50
commit 01e8433889
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 6 additions and 3 deletions

View File

@ -580,6 +580,7 @@ class CustomNone():
def __len__():
return 0
__int__ = __len__
__hash__ = __len__
__index__ = __len__

View File

@ -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,7 +808,8 @@ def hash(value):
array = [1, 2, 3]
self.assertEqual(array[obj], 1)
self.assertTrue(time.localtime(obj))
if platform.python_implementation().lower() == "cpython":
self.assertTrue(time.localtime(obj))
i = 0
for _ in obj: