def test_copy(self, mocker: MockerFixture, tmp_path: Path) -> None:
        """Test copy."""
        mocker.patch.object(DeployEnvironment, "name", "test")
        obj = DeployEnvironment(root_dir=tmp_path)
        obj_copy = obj.copy()

        assert obj_copy != obj
        assert obj_copy._ignore_git_branch == obj._ignore_git_branch
        assert obj_copy.name == obj.name
        assert obj_copy.name_derived_from == obj.name_derived_from
        assert obj_copy.root_dir == obj.root_dir
        assert obj_copy.vars == obj.vars
示例#2
0
    def test_copy(self, monkeypatch, tmp_path):
        """Test copy."""
        monkeypatch.setattr(DeployEnvironment, "name", "test")
        obj = DeployEnvironment(root_dir=tmp_path)
        obj_copy = obj.copy()

        assert obj_copy != obj
        assert obj_copy._ignore_git_branch == obj._ignore_git_branch
        assert obj_copy.name == obj.name
        assert obj_copy.name_derived_from == obj.name_derived_from
        assert obj_copy.root_dir == obj.root_dir
        assert obj_copy.vars == obj.vars