mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'kovidgoyal:master' into master
This commit is contained in:
commit
81cff63645
@ -217,7 +217,7 @@ def deep_eq(a, b):
|
|||||||
if ka.length is not Object.keys(b).length:
|
if ka.length is not Object.keys(b).length:
|
||||||
return False
|
return False
|
||||||
for key in ka:
|
for key in ka:
|
||||||
if not deep_eq(a[ka], b[ka]):
|
if not deep_eq(a[key], b[key]):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ from __python__ import bound_methods, hash_literals
|
|||||||
|
|
||||||
from testing import assert_equal, test
|
from testing import assert_equal, test
|
||||||
from utils import fmt_sidx, human_readable, rating_to_stars
|
from utils import fmt_sidx, human_readable, rating_to_stars
|
||||||
|
from session import deep_eq
|
||||||
|
|
||||||
|
|
||||||
@test
|
@test
|
||||||
@ -12,3 +13,4 @@ def misc_utils():
|
|||||||
assert_equal(fmt_sidx(10), 'X')
|
assert_equal(fmt_sidx(10), 'X')
|
||||||
assert_equal(fmt_sidx(1.2), '1.20')
|
assert_equal(fmt_sidx(1.2), '1.20')
|
||||||
assert_equal(list(map(human_readable, [1, 1024.0, 1025, 1024*1024*2.3])), ["1 B", "1 KB", "1 KB", "2.3 MB"])
|
assert_equal(list(map(human_readable, [1, 1024.0, 1025, 1024*1024*2.3])), ["1 B", "1 KB", "1 KB", "2.3 MB"])
|
||||||
|
assert_equal(False, deep_eq({"portrait":0, "landscape":0}, {"landscape":3, "portrait":0}))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user