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

Class deepcopy

tests/parser_context.py:134–157  ·  view source on GitHub ↗

__deepcopy__

Source from the content-addressed store, hash-verified

132 assert self.c.args["hrm"].value == self.c.positional_args[0].value
133
134 class deepcopy:
135 "__deepcopy__"
136
137 def setup_method(self):
138 self.arg = Argument("--boolean")
139 self.orig = Context(
140 name="mytask", args=(self.arg,), aliases=("othername",)
141 )
142 self.new = copy.deepcopy(self.orig)
143
144 def returns_correct_copy(self):
145 assert self.new is not self.orig
146 assert self.new.name == "mytask"
147 assert "othername" in self.new.aliases
148
149 def includes_arguments(self):
150 assert len(self.new.args) == 1
151 assert self.new.args["--boolean"] is not self.arg
152
153 def modifications_to_copied_arguments_do_not_touch_originals(self):
154 new_arg = self.new.args["--boolean"]
155 new_arg.value = True
156 assert new_arg.value
157 assert not self.arg.value
158
159 class help_for:
160 def setup_method(self):

Callers 1

clone_dataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…