def test_update_recursive(self): d = Options( foo='bar', baz=Options(ham=2, eggs=4)) d.update(Options(baz=Options(eggs=5))) assert d.foo == 'bar' assert d.baz.ham == 2 assert d.baz.eggs == 5
def test_update_new(self): d = Options(foo='bar', baz=4) d.update(Options(biz=5)) assert d.baz == 4 assert d.biz == 5 assert d.foo == 'bar'
def test_update_overwrite(self): d = Options(foo='bar', baz=4) d.update(Options(baz=5)) assert d.baz == 5 assert d.foo == 'bar'
def test_compare(self): assert Options(foo=4) == Options(foo=4) assert Options(foo=Options(bar=4)) == Options(foo=Options(bar=4))