Compare commits

...

2 Commits

Author SHA1 Message Date
Florian Bach a9519fbd20 Fix loan list for nameless books 1 year ago
Florian Bach 93d732f0d6 Update tests 1 year ago

@ -5,12 +5,12 @@ It is a full Python reimplementation of libgourou by Grégory Soutadé (http://i
extended by more and more features.
<details>
<summary>ACSM Input Plugin for Calibre - Copyright (c) 2021-2022 Leseratte10</summary>
<summary>ACSM Input Plugin for Calibre - Copyright (c) 2021-2023 Leseratte10</summary>
```
ACSM Input Plugin for Calibre / acsm-calibre-plugin
Formerly known as "DeACSM"
Copyright (c) 2021-2022 Leseratte10
Copyright (c) 2021-2023 Leseratte10
This software is based on a Python reimplementation of the C++ library
"libgourou" by Grégory Soutadé which is under the LGPLv3 or later

@ -486,7 +486,6 @@ class ACSMInput(FileTypePlugin):
self.unblock()
return path_to_ebook
# That's an ACSM.
# We would fulfill this now, but first perform some sanity checks ...
if not self.ADE_sanity_check():

@ -1416,7 +1416,11 @@ class RentedBooksDialog(QDialog):
info = "(" + self.td_format(timestamp - currenttime) + " remaining)"
item = QListWidgetItem(book["book_name"] + " " + info)
book_name = book["book_name"]
if book_name is None:
book_name = "(unknown book)"
item = QListWidgetItem(book_name + " " + info)
item.setData(QtCore.Qt.UserRole, book["loanID"])
self.listy.addItem(item)

@ -120,13 +120,14 @@ class TestAdobe(unittest.TestCase):
@freeze_time("2031-07-19 22:15:22.074860")
def test_verifyNonceCalculationFuture(self):
'''Check if the nonce calculation is still correct in the future'''
@freeze_time("2038-04-27 03:34:32.543157")
def test_verifyNonceCalculationYk38(self):
'''Check if the nonce calculation works after 2038'''
nonce_return = libadobe.addNonce()
expected_return = "<adept:nonce>2lQTp046AAAAAAAA</adept:nonce><adept:expiration>2031-07-19T22:25:22Z</adept:expiration>"
self.assertEqual(nonce_return, expected_return, "Invalid nonce calculation in 2031")
expected_return = "<adept:nonce>X0fGZ4A6AAAAAAAA</adept:nonce><adept:expiration>2038-04-27T03:44:32Z</adept:expiration>"
self.assertEqual(nonce_return, expected_return, "Invalid nonce calculation in 2038, 2k38 problem")

Loading…
Cancel
Save