本文整理汇总了Python中gnome.movers.WindMover.__getattribute__方法的典型用法代码示例。如果您正苦于以下问题:Python WindMover.__getattribute__方法的具体用法?Python WindMover.__getattribute__怎么用?Python WindMover.__getattribute__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnome.movers.WindMover
的用法示例。
在下文中一共展示了WindMover.__getattribute__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_new_from_dict
# 需要导入模块: from gnome.movers import WindMover [as 别名]
# 或者: from gnome.movers.WindMover import __getattribute__ [as 别名]
def test_new_from_dict():
"""
Currently only checks that new object can be created from dict
It does not check equality of objects
"""
wind = environment.Wind(filename=file_)
wm = WindMover(wind) # WindMover does not modify Wind object!
wm_state = wm.to_dict('create')
# must create a Wind object and add this to wm_state dict
wind2 = environment.Wind.new_from_dict(wind.to_dict('create'))
wm_state.update({'wind': wind2})
wm2 = WindMover.new_from_dict(wm_state)
# check serializable state is correct
assert all([wm.__getattribute__(k) == wm2.__getattribute__(k)
for k in WindMover.state.get_names('create') if k
!= 'wind_id' and k != 'obj_type'])
assert wm.wind.id == wm2.wind.id