Skip to content

Commit e266fda

Browse files
committed
[#184] Unit test added
1 parent bb6a4f8 commit e266fda

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

datastock/_class1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ def remove_param(
369369
###########
370370

371371
@classmethod
372-
def from_dict(cls, din=None, sep=None):
373-
obj = super().from_dict(din=din, sep=sep)
372+
def from_dict(cls, din=None, sep=None, obj=None):
373+
obj = super().from_dict(din=din, sep=sep, obj=obj)
374374
obj.update()
375375
return obj
376376

datastock/tests/test_01_DataStock.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,16 @@ def test24_saveload(self, verb=False):
612612
st2 = load(pfe, verb=verb)
613613
# Just to check the loaded version works fine
614614
msg = st2.__eq__(self.st, returnas=str)
615+
if msg is not True:
616+
raise Exception(msg)
617+
os.remove(pfe)
618+
619+
def test25_saveload_coll(self, verb=False):
620+
pfe = self.st.save(path=_PATH_OUTPUT, verb=verb, return_pfe=True)
621+
st = DataStock()
622+
st2 = load(pfe, coll=st, verb=verb)
623+
# Just to check the loaded version works fine
624+
msg = st2.__eq__(self.st, returnas=str)
615625
if msg is not True:
616626
raise Exception(msg)
617627
os.remove(pfe)

0 commit comments

Comments
 (0)