# Path: pyledger/server/status.py
# class BaseStatus(abc.ABC):
#     """
#     Status abstract class
#     """
#     @abc.abstractmethod
#     def dump(self):
#         pass
# 
#     @abc.abstractmethod
#     def load(self, dump: bytes):
#         pass
# 
#     @abc.abstractmethod
#     def to_dict(self):
#         pass
# 
# class SimpleStatus(BaseStatus):
#     """
#     Simple status for the smart contract based on a dictionary.
#     """
#     def __init__(self, **kwargs):
#         self.args_list = [a for a in kwargs]
# 
#         for k, v in kwargs.items():
#             setattr(self, k, v)
# 
#     def dump(self):
#         return pickle.dumps({k: getattr(self, k) for k in self.args_list})
# 
#     def load(self, dump: bytes):
#         status = pickle.loads(dump)
#         self.args_list = [a for a in status]
# 
#         for k, v in status.items():
#             setattr(self, k, v)
# 
#     def to_dict(self):
#         return {k: getattr(self, k) for k in self.args_list}
# 
#     def __contains__(self, item):
#         return item in self.__dict__
# 
#     def __repr__(self):
#         return 'Pyledger status with attributes {}'.format(
#             self.args_list)


from pyledger.server.status import BaseStatus, SimpleStatus
#    Pyledger. A simple ledger for smart contracts implemented in Python
#    Copyright (C) 2017  Guillem Borrell Nogueras
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as published
#    by the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.
#
#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.



def test_1():
    status = SimpleStatus(key='value')
    assert isinstance(status, BaseStatus) == True
    assert ('key' in status) == True


def test_2():

# Path: pyledger/server/status.py
# class BaseStatus(abc.ABC):
#     """
#     Status abstract class
#     """
#     @abc.abstractmethod
#     def dump(self):
#         pass
# 
#     @abc.abstractmethod
#     def load(self, dump: bytes):
#         pass
# 
#     @abc.abstractmethod
#     def to_dict(self):
#         pass
# 
# class SimpleStatus(BaseStatus):
#     """
#     Simple status for the smart contract based on a dictionary.
#     """
#     def __init__(self, **kwargs):
#         self.args_list = [a for a in kwargs]
# 
#         for k, v in kwargs.items():
#             setattr(self, k, v)
# 
#     def dump(self):
#         return pickle.dumps({k: getattr(self, k) for k in self.args_list})
# 
#     def load(self, dump: bytes):
#         status = pickle.loads(dump)
#         self.args_list = [a for a in status]
# 
#         for k, v in status.items():
#             setattr(self, k, v)
# 
#     def to_dict(self):
#         return {k: getattr(self, k) for k in self.args_list}
# 
#     def __contains__(self, item):
#         return item in self.__dict__
# 
#     def __repr__(self):
#         return 'Pyledger status with attributes {}'.format(
#             self.args_list)


# Path: tests/test_4_status.py
from pyledger.server.status import BaseStatus, SimpleStatus

#    Pyledger. A simple ledger for smart contracts implemented in Python
#    Copyright (C) 2017  Guillem Borrell Nogueras
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as published
#    by the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.
#
#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.



def test_1():
    status = SimpleStatus(key='value')
    assert isinstance(status, BaseStatus) == True
    assert ('key' in status) == True


def test_2():

    status = SimpleStatus(accounts={})