Start writing tests for inventory #2165

Merged
PeterSurda merged 8 commits from gitea-39 into v0.6 2023-11-21 16:51:05 +01:00
Showing only changes of commit 81f574c618 - Show all commits

View File

@ -1,10 +1,15 @@
""" """
Storing inventory items Storing inventory items
""" """
import collections
InventoryItem = collections.namedtuple( from collections import namedtuple
'InventoryItem', 'type stream payload expires tag') try:
from collections import MutableMapping # pylint: disable=deprecated-class
except ImportError:
from collections.abc import MutableMapping
InventoryItem = namedtuple('InventoryItem', 'type stream payload expires tag')
class Storage(object): # pylint: disable=too-few-public-methods class Storage(object): # pylint: disable=too-few-public-methods
@ -13,7 +18,7 @@ class Storage(object): # pylint: disable=too-few-public-methods
pass pass
class InventoryStorage(Storage, collections.MutableMapping): class InventoryStorage(Storage, MutableMapping):
"""Module used for inventory storage""" """Module used for inventory storage"""
def __init__(self): # pylint: disable=super-init-not-called def __init__(self): # pylint: disable=super-init-not-called
@ -54,7 +59,7 @@ class InventoryStorage(Storage, collections.MutableMapping):
raise NotImplementedError raise NotImplementedError
class MailboxStorage(Storage, collections.MutableMapping): class MailboxStorage(Storage, MutableMapping):
"""Method for storing mails""" """Method for storing mails"""
def __delitem__(self, key): def __delitem__(self, key):