-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PIP resolution; fix windows lockfile format (#220)
* Add failing format test with CRLF * Add fix for windows newline in pip parser
- Loading branch information
1 parent
b9bd193
commit db811e6
Showing
3 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
internal/resolution/pm/pip/testdata/crlf_cmd_factory_mock.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package testdata | ||
|
||
import ( | ||
"os/exec" | ||
) | ||
|
||
type CmdFactoryMockCRLF struct { | ||
CreateVenvCmdName string | ||
MakeCreateVenvErr error | ||
InstallCmdName string | ||
MakeInstallErr error | ||
CatCmdName string | ||
MakeCatErr error | ||
ListCmdName string | ||
MakeListErr error | ||
ShowCmdName string | ||
MakeShowErr error | ||
} | ||
|
||
func NewCRLFEchoCmdFactory() CmdFactoryMockCRLF { | ||
return CmdFactoryMockCRLF{ | ||
CreateVenvCmdName: "echo", | ||
InstallCmdName: "echo", | ||
CatCmdName: "echo", | ||
ListCmdName: "echo", | ||
ShowCmdName: "echo", | ||
} | ||
} | ||
|
||
func (f CmdFactoryMockCRLF) MakeCreateVenvCmd(file string) (*exec.Cmd, error) { | ||
return exec.Command(f.CreateVenvCmdName, file), f.MakeCreateVenvErr | ||
} | ||
|
||
func (f CmdFactoryMockCRLF) MakeInstallCmd(command string, file string) (*exec.Cmd, error) { | ||
return exec.Command(f.InstallCmdName, file), f.MakeInstallErr | ||
} | ||
|
||
func (f CmdFactoryMockCRLF) MakeListCmd(command string) (*exec.Cmd, error) { | ||
return exec.Command(f.ListCmdName, "Package Version Editable project location\r\n----------------------------- ------------ ------------------------------------------------------\r\nFlask 2.0.3"), f.MakeListErr | ||
} | ||
|
||
func (f CmdFactoryMockCRLF) MakeCatCmd(file string) (*exec.Cmd, error) { | ||
return exec.Command(f.CatCmdName, "Flask==2.1.5\r\n"), f.MakeCatErr | ||
} | ||
|
||
func (f CmdFactoryMockCRLF) MakeShowCmd(command string, list []string) (*exec.Cmd, error) { | ||
return exec.Command(f.ShowCmdName, "Name: Flask\r\nVersion: 2.1.2\r\nSummary: A simple framework for building complex web applications.\r\nHome-page: https://palletsprojects.com/p/flask\r\nAuthor: Armin Ronacher\r\nAuthor-email: [email protected]\r\nLicense: BSD-3-Clause\r\nLocation: /path/to/site-packages\r\nRequires: click, importlib-metadata, itsdangerous, Jinja2, Werkzeug\r\nRequired-by: Flask-Script, Flask-Compress, Flask-Bcrypt\r\n"), f.MakeShowErr | ||
} |