@@ -21,14 +21,14 @@ def test_subprocess_get(git_helper, mocker):
21
21
run = mocker .patch (
22
22
"subprocess.run" ,
23
23
return_value = mocker .Mock (
24
- stdout = os . linesep .join (
24
+ stdout = " \n " .join (
25
25
["protocol=https" , "host=foo.com" , "username=foo" , "password=bar" , "" ]
26
26
)
27
27
),
28
28
)
29
29
creds = git_helper .get (Credential (protocol = "https" , host = "foo.com" , path = "foo.git" ))
30
30
assert run .call_args .args [0 ] == ["git-credential-foo" , "get" ]
31
- assert run .call_args .kwargs .get ("input" ) == os . linesep .join (
31
+ assert run .call_args .kwargs .get ("input" ) == " \n " .join (
32
32
["protocol=https" , "host=foo.com" , "" ]
33
33
)
34
34
assert creds == Credential (url = "https://foo:bar@foo.com" )
@@ -39,12 +39,12 @@ def test_subprocess_get_use_http_path(git_helper, mocker):
39
39
run = mocker .patch (
40
40
"subprocess.run" ,
41
41
return_value = mocker .Mock (
42
- stdout = os . linesep .join (["username=foo" , "password=bar" , "" ])
42
+ stdout = " \n " .join (["username=foo" , "password=bar" , "" ])
43
43
),
44
44
)
45
45
creds = git_helper .get (Credential (protocol = "https" , host = "foo.com" , path = "foo.git" ))
46
46
assert run .call_args .args [0 ] == ["git-credential-foo" , "get" ]
47
- assert run .call_args .kwargs .get ("input" ) == os . linesep .join (
47
+ assert run .call_args .kwargs .get ("input" ) == " \n " .join (
48
48
["protocol=https" , "host=foo.com" , "path=foo.git" , "" ]
49
49
)
50
50
assert creds == Credential (username = "foo" , password = "bar" )
@@ -59,7 +59,7 @@ def test_subprocess_get_failed(git_helper, mocker):
59
59
60
60
61
61
def test_subprocess_get_no_output (git_helper , mocker ):
62
- mocker .patch ("subprocess.run" , return_value = mocker .Mock (stdout = os . linesep ))
62
+ mocker .patch ("subprocess.run" , return_value = mocker .Mock (stdout = " \n " ))
63
63
with pytest .raises (CredentialNotFoundError ):
64
64
git_helper .get (Credential (protocol = "https" , host = "foo.com" ))
65
65
@@ -70,7 +70,7 @@ def test_subprocess_store(git_helper, mocker):
70
70
Credential (protocol = "https" , host = "foo.com" , username = "foo" , password = "bar" )
71
71
)
72
72
assert run .call_args .args [0 ] == ["git-credential-foo" , "store" ]
73
- assert run .call_args .kwargs .get ("input" ) == os . linesep .join (
73
+ assert run .call_args .kwargs .get ("input" ) == " \n " .join (
74
74
["protocol=https" , "host=foo.com" , "username=foo" , "password=bar" , "" ]
75
75
)
76
76
@@ -79,7 +79,7 @@ def test_subprocess_erase(git_helper, mocker):
79
79
run = mocker .patch ("subprocess.run" )
80
80
git_helper .erase (Credential (protocol = "https" , host = "foo.com" ))
81
81
assert run .call_args .args [0 ] == ["git-credential-foo" , "erase" ]
82
- assert run .call_args .kwargs .get ("input" ) == os . linesep .join (
82
+ assert run .call_args .kwargs .get ("input" ) == " \n " .join (
83
83
["protocol=https" , "host=foo.com" , "" ]
84
84
)
85
85
@@ -149,7 +149,7 @@ def test_memory_helper_prompt_askpass(mocker):
149
149
"subprocess.run" ,
150
150
side_effect = [
151
151
mocker .Mock (stdout = "foo" ),
152
- mocker .Mock (stdout = os . linesep .join (["bar" , "" ])),
152
+ mocker .Mock (stdout = " \n " .join (["bar" , "" ])),
153
153
],
154
154
)
155
155
expected = Credential (
0 commit comments