def test_propclass_empty_setitem(mocker):
mocker.patch(
'time.localtime',
return_value=time.struct_time((2016, 11, 7, 15, 29, 40, 0, 312, 0)),
)
p = Properties()
p["key"] = "value"
assert len(p) == 1
assert bool(p)
assert dict(p) == {"key": "value"}
s = StringIO()
p.store(s)
assert s.getvalue() == '#Mon Nov 07 15:29:40 EST 2016\nkey=value\n'
time.localtime.assert_called_once_with(None)
# store() when non-empty (with & without comment)
# dumps() function?
# defaults with defaults
# asserting `load` doesn't affect `defaults`
# equality when `defaults` is involved
# loadFromXML
# storeToXML (with & without comment)
评论列表
文章目录