MCPcopy Index your code
hub / github.com/pyinvoke/invoke / setdefault

Method setdefault

tests/context.py:122–128  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

120 assert self.c.config == {}
121
122 def setdefault(self):
123 assert self.c.setdefault("foo") == "bar"
124 assert self.c.biz.setdefault("baz") == "boz"
125 assert self.c.setdefault("notfoo", "notbar") == "notbar"
126 assert self.c.notfoo == "notbar"
127 assert self.c.biz.setdefault("otherbaz", "otherboz") == "otherboz"
128 assert self.c.biz.otherbaz == "otherboz"
129
130 def update(self):
131 self.c.update({"newkey": "newval"})

Callers 1

uses_MyTaskMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected