mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-25 08:37:07 +01:00
fix typo in PicklePersistence (#1488)
* fix single typo * fix unitests for picle singe_file -> single_file
This commit is contained in:
parent
b71196dad3
commit
ec6dc7fa10
2 changed files with 9 additions and 9 deletions
|
@ -56,12 +56,12 @@ class PicklePersistence(BasePersistence):
|
|||
on any transaction *and* on call fo :meth:`flush`. Default is ``False``.
|
||||
"""
|
||||
|
||||
def __init__(self, filename, store_user_data=True, store_chat_data=True, singe_file=True,
|
||||
def __init__(self, filename, store_user_data=True, store_chat_data=True, single_file=True,
|
||||
on_flush=False):
|
||||
self.filename = filename
|
||||
self.store_user_data = store_user_data
|
||||
self.store_chat_data = store_chat_data
|
||||
self.single_file = singe_file
|
||||
self.single_file = single_file
|
||||
self.on_flush = on_flush
|
||||
self.user_data = None
|
||||
self.chat_data = None
|
||||
|
|
|
@ -224,7 +224,7 @@ def pickle_persistence():
|
|||
return PicklePersistence(filename='pickletest',
|
||||
store_user_data=True,
|
||||
store_chat_data=True,
|
||||
singe_file=False,
|
||||
single_file=False,
|
||||
on_flush=False)
|
||||
|
||||
|
||||
|
@ -233,7 +233,7 @@ def pickle_persistence_only_chat():
|
|||
return PicklePersistence(filename='pickletest',
|
||||
store_user_data=False,
|
||||
store_chat_data=True,
|
||||
singe_file=False,
|
||||
single_file=False,
|
||||
on_flush=False)
|
||||
|
||||
|
||||
|
@ -242,7 +242,7 @@ def pickle_persistence_only_user():
|
|||
return PicklePersistence(filename='pickletest',
|
||||
store_user_data=True,
|
||||
store_chat_data=False,
|
||||
singe_file=False,
|
||||
single_file=False,
|
||||
on_flush=False)
|
||||
|
||||
|
||||
|
@ -552,7 +552,7 @@ class TestPickelPersistence(object):
|
|||
pickle_persistence_2 = PicklePersistence(filename='pickletest',
|
||||
store_user_data=True,
|
||||
store_chat_data=True,
|
||||
singe_file=False,
|
||||
single_file=False,
|
||||
on_flush=False)
|
||||
u = Updater(bot=bot, persistence=pickle_persistence_2)
|
||||
dp = u.dispatcher
|
||||
|
@ -572,7 +572,7 @@ class TestPickelPersistence(object):
|
|||
pickle_persistence_2 = PicklePersistence(filename='pickletest',
|
||||
store_user_data=True,
|
||||
store_chat_data=True,
|
||||
singe_file=False,
|
||||
single_file=False,
|
||||
on_flush=False)
|
||||
assert pickle_persistence_2.get_user_data()[4242424242]['my_test'] == 'Working!'
|
||||
assert pickle_persistence_2.get_chat_data()[-4242424242]['my_test2'] == 'Working2!'
|
||||
|
@ -592,7 +592,7 @@ class TestPickelPersistence(object):
|
|||
pickle_persistence_2 = PicklePersistence(filename='pickletest',
|
||||
store_user_data=False,
|
||||
store_chat_data=True,
|
||||
singe_file=False,
|
||||
single_file=False,
|
||||
on_flush=False)
|
||||
assert pickle_persistence_2.get_user_data() == {}
|
||||
assert pickle_persistence_2.get_chat_data()[-4242424242]['my_test2'] == 'Working2!'
|
||||
|
@ -611,7 +611,7 @@ class TestPickelPersistence(object):
|
|||
pickle_persistence_2 = PicklePersistence(filename='pickletest',
|
||||
store_user_data=True,
|
||||
store_chat_data=False,
|
||||
singe_file=False,
|
||||
single_file=False,
|
||||
on_flush=False)
|
||||
assert pickle_persistence_2.get_user_data()[4242424242]['my_test'] == 'Working!'
|
||||
assert pickle_persistence_2.get_chat_data()[-4242424242] == {}
|
||||
|
|
Loading…
Reference in a new issue