diff --git a/telegram/ext/picklepersistence.py b/telegram/ext/picklepersistence.py index de42a9152..1684b685a 100644 --- a/telegram/ext/picklepersistence.py +++ b/telegram/ext/picklepersistence.py @@ -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 diff --git a/tests/test_persistence.py b/tests/test_persistence.py index 86fe4433f..6797c0d02 100644 --- a/tests/test_persistence.py +++ b/tests/test_persistence.py @@ -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] == {}