Fix unit test error
1. What is the problem Unit tests fail due to miss function of update_fields. 2. What is the solution for the problem Add update_fields function. 3. What features need to be implemented to the Tricircle to realize the solution N/A Change-Id: I41bff60b4c4cffb1eddde9e2733c4ebaa9ad948c
This commit is contained in:
parent
815d1ff008
commit
827d9b5b75
|
@ -107,6 +107,9 @@ class DotDict(dict):
|
||||||
return dummy_value_map[item]
|
return dummy_value_map[item]
|
||||||
return self.get(item)
|
return self.get(item)
|
||||||
|
|
||||||
|
def __setattr__(self, name, value):
|
||||||
|
self[name] = value
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
@ -119,6 +122,11 @@ class DotDict(dict):
|
||||||
def save(self, session=None):
|
def save(self, session=None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def update_fields(self, obj_data):
|
||||||
|
for k, v in obj_data.items():
|
||||||
|
if k in self:
|
||||||
|
setattr(self, k, v)
|
||||||
|
|
||||||
|
|
||||||
class DotList(list):
|
class DotList(list):
|
||||||
def all(self):
|
def all(self):
|
||||||
|
|
Loading…
Reference in New Issue