11from pathlib import Path
2- from unittest .mock import call , patch
2+ from unittest .mock import call , patch , ANY
33
44import pytest
55
@@ -40,8 +40,8 @@ async def test_get_current_branch_success():
4040 mock_execute .assert_called_once_with (
4141 ["git" , "symbolic-ref" , "--short" , "HEAD" ],
4242 cwd = str (Path ("/bin" ) / "test_curr_path" ),
43- timeout = 20 ,
44- env = None ,
43+ timeout = 20.0 ,
44+ env = ANY ,
4545 username = None ,
4646 password = None ,
4747 is_binary = False ,
@@ -78,8 +78,8 @@ async def test_checkout_branch_noref_success():
7878 mock_execute .assert_called_once_with (
7979 cmd ,
8080 cwd = str (Path ("/bin" ) / "test_curr_path" ),
81- timeout = 20 ,
82- env = None ,
81+ timeout = 20.0 ,
82+ env = ANY ,
8383 username = None ,
8484 password = None ,
8585 is_binary = False ,
@@ -118,8 +118,8 @@ async def test_checkout_branch_noref_failure():
118118 mock_execute .assert_called_once_with (
119119 cmd ,
120120 cwd = str (Path ("/bin" ) / "test_curr_path" ),
121- timeout = 20 ,
122- env = None ,
121+ timeout = 20.0 ,
122+ env = ANY ,
123123 username = None ,
124124 password = None ,
125125 is_binary = False ,
@@ -164,8 +164,8 @@ async def test_checkout_branch_remoteref_success():
164164 mock_execute .assert_called_once_with (
165165 cmd ,
166166 cwd = str (Path ("/bin" ) / "test_curr_path" ),
167- timeout = 20 ,
168- env = None ,
167+ timeout = 20.0 ,
168+ env = ANY ,
169169 username = None ,
170170 password = None ,
171171 is_binary = False ,
@@ -207,8 +207,8 @@ async def test_checkout_branch_headsref_failure():
207207 mock_execute .assert_called_once_with (
208208 cmd ,
209209 cwd = str (Path ("/bin" ) / "test_curr_path" ),
210- timeout = 20 ,
211- env = None ,
210+ timeout = 20.0 ,
211+ env = ANY ,
212212 username = None ,
213213 password = None ,
214214 is_binary = False ,
@@ -248,8 +248,8 @@ async def test_checkout_branch_headsref_success():
248248 mock_execute .assert_called_once_with (
249249 cmd ,
250250 cwd = str (Path ("/bin" ) / "test_curr_path" ),
251- timeout = 20 ,
252- env = None ,
251+ timeout = 20.0 ,
252+ env = ANY ,
253253 username = None ,
254254 password = None ,
255255 is_binary = False ,
@@ -288,8 +288,8 @@ async def test_checkout_branch_remoteref_failure():
288288 mock_execute .assert_called_once_with (
289289 cmd ,
290290 cwd = str (Path ("/bin" ) / "test_curr_path" ),
291- timeout = 20 ,
292- env = None ,
291+ timeout = 20.0 ,
292+ env = ANY ,
293293 username = None ,
294294 password = None ,
295295 is_binary = False ,
@@ -320,8 +320,8 @@ async def test_get_branch_reference_success():
320320 mock_execute .assert_called_once_with (
321321 ["git" , "rev-parse" , "--symbolic-full-name" , branch ],
322322 cwd = str (Path ("/bin" ) / "test_curr_path" ),
323- timeout = 20 ,
324- env = None ,
323+ timeout = 20.0 ,
324+ env = ANY ,
325325 username = None ,
326326 password = None ,
327327 is_binary = False ,
@@ -355,8 +355,8 @@ async def test_get_branch_reference_failure():
355355 mock_execute .assert_called_once_with (
356356 ["git" , "rev-parse" , "--symbolic-full-name" , branch ],
357357 cwd = str (Path ("/bin" ) / "test_curr_path" ),
358- timeout = 20 ,
359- env = None ,
358+ timeout = 20.0 ,
359+ env = ANY ,
360360 username = None ,
361361 password = None ,
362362 is_binary = False ,
@@ -384,8 +384,8 @@ async def test_get_current_branch_failure():
384384 mock_execute .assert_called_once_with (
385385 ["git" , "symbolic-ref" , "--short" , "HEAD" ],
386386 cwd = str (Path ("/bin" ) / "test_curr_path" ),
387- timeout = 20 ,
388- env = None ,
387+ timeout = 20.0 ,
388+ env = ANY ,
389389 username = None ,
390390 password = None ,
391391 is_binary = False ,
@@ -418,8 +418,8 @@ async def test_get_current_branch_detached_success():
418418 mock_execute .assert_called_once_with (
419419 ["git" , "branch" , "-a" ],
420420 cwd = str (Path ("/bin" ) / "test_curr_path" ),
421- timeout = 20 ,
422- env = None ,
421+ timeout = 20.0 ,
422+ env = ANY ,
423423 username = None ,
424424 password = None ,
425425 is_binary = False ,
@@ -449,8 +449,8 @@ async def test_get_current_branch_detached_failure():
449449 mock_execute .assert_called_once_with (
450450 ["git" , "branch" , "-a" ],
451451 cwd = str (Path ("/bin" ) / "test_curr_path" ),
452- timeout = 20 ,
453- env = None ,
452+ timeout = 20.0 ,
453+ env = ANY ,
454454 username = None ,
455455 password = None ,
456456 is_binary = False ,
@@ -497,17 +497,17 @@ async def test_get_upstream_branch_success(branch, upstream, remotename):
497497 "{}@{{upstream}}" .format (branch ),
498498 ],
499499 cwd = str (Path ("/bin" ) / "test_curr_path" ),
500- timeout = 20 ,
501- env = None ,
500+ timeout = 20.0 ,
501+ env = ANY ,
502502 username = None ,
503503 password = None ,
504504 is_binary = False ,
505505 ),
506506 call (
507507 ["git" , "config" , "--local" , "branch.{}.remote" .format (branch )],
508508 cwd = str (Path ("/bin" ) / "test_curr_path" ),
509- timeout = 20 ,
510- env = None ,
509+ timeout = 20.0 ,
510+ env = ANY ,
511511 username = None ,
512512 password = None ,
513513 is_binary = False ,
@@ -565,8 +565,8 @@ async def test_get_upstream_branch_failure(outputs, message):
565565 call (
566566 ["git" , "rev-parse" , "--abbrev-ref" , "blah@{upstream}" ],
567567 cwd = str (Path ("/bin" ) / "test_curr_path" ),
568- timeout = 20 ,
569- env = None ,
568+ timeout = 20.0 ,
569+ env = ANY ,
570570 username = None ,
571571 password = None ,
572572 is_binary = False ,
@@ -592,8 +592,8 @@ async def test_get_tag_success():
592592 mock_execute .assert_called_once_with (
593593 ["git" , "describe" , "--tags" , "abcdefghijklmnopqrstuvwxyz01234567890123" ],
594594 cwd = str (Path ("/bin" ) / "test_curr_path" ),
595- timeout = 20 ,
596- env = None ,
595+ timeout = 20.0 ,
596+ env = ANY ,
597597 username = None ,
598598 password = None ,
599599 is_binary = False ,
@@ -641,8 +641,8 @@ async def test_get_tag_failure():
641641 call (
642642 ["git" , "describe" , "--tags" , "blah" ],
643643 cwd = str (Path ("/bin" ) / "test_curr_path" ),
644- timeout = 20 ,
645- env = None ,
644+ timeout = 20.0 ,
645+ env = ANY ,
646646 username = None ,
647647 password = None ,
648648 is_binary = False ,
@@ -655,8 +655,8 @@ async def test_get_tag_failure():
655655 "01234567899999abcdefghijklmnopqrstuvwxyz" ,
656656 ],
657657 cwd = str (Path ("/bin" ) / "test_curr_path" ),
658- timeout = 20 ,
659- env = None ,
658+ timeout = 20.0 ,
659+ env = ANY ,
660660 username = None ,
661661 password = None ,
662662 is_binary = False ,
@@ -683,8 +683,8 @@ async def test_no_tags():
683683 mock_execute .assert_called_once_with (
684684 ["git" , "describe" , "--tags" , "768c79ad661598889f29bdf8916f4cc488f5062a" ],
685685 cwd = "/path/foo" ,
686- timeout = 20 ,
687- env = None ,
686+ timeout = 20.0 ,
687+ env = ANY ,
688688 username = None ,
689689 password = None ,
690690 is_binary = False ,
@@ -782,8 +782,8 @@ async def test_branch_success():
782782 "refs/heads/" ,
783783 ],
784784 cwd = str (Path ("/bin" ) / "test_curr_path" ),
785- timeout = 20 ,
786- env = None ,
785+ timeout = 20.0 ,
786+ env = ANY ,
787787 username = None ,
788788 password = None ,
789789 is_binary = False ,
@@ -797,8 +797,8 @@ async def test_branch_success():
797797 "refs/remotes/" ,
798798 ],
799799 cwd = str (Path ("/bin" ) / "test_curr_path" ),
800- timeout = 20 ,
801- env = None ,
800+ timeout = 20.0 ,
801+ env = ANY ,
802802 username = None ,
803803 password = None ,
804804 is_binary = False ,
@@ -840,8 +840,8 @@ async def test_branch_failure():
840840 mock_execute .assert_called_once_with (
841841 expected_cmd ,
842842 cwd = str (Path ("/bin" ) / "test_curr_path" ),
843- timeout = 20 ,
844- env = None ,
843+ timeout = 20.0 ,
844+ env = ANY ,
845845 username = None ,
846846 password = None ,
847847 is_binary = False ,
@@ -930,8 +930,8 @@ async def test_branch_success_detached_head():
930930 "refs/heads/" ,
931931 ],
932932 cwd = str (Path ("/bin" ) / "test_curr_path" ),
933- timeout = 20 ,
934- env = None ,
933+ timeout = 20.0 ,
934+ env = ANY ,
935935 username = None ,
936936 password = None ,
937937 is_binary = False ,
@@ -940,8 +940,8 @@ async def test_branch_success_detached_head():
940940 call (
941941 ["git" , "symbolic-ref" , "--short" , "HEAD" ],
942942 cwd = str (Path ("/bin" ) / "test_curr_path" ),
943- timeout = 20 ,
944- env = None ,
943+ timeout = 20.0 ,
944+ env = ANY ,
945945 username = None ,
946946 password = None ,
947947 is_binary = False ,
@@ -950,8 +950,8 @@ async def test_branch_success_detached_head():
950950 call (
951951 ["git" , "branch" , "-a" ],
952952 cwd = str (Path ("/bin" ) / "test_curr_path" ),
953- timeout = 20 ,
954- env = None ,
953+ timeout = 20.0 ,
954+ env = ANY ,
955955 username = None ,
956956 password = None ,
957957 is_binary = False ,
@@ -965,8 +965,8 @@ async def test_branch_success_detached_head():
965965 "refs/remotes/" ,
966966 ],
967967 cwd = str (Path ("/bin" ) / "test_curr_path" ),
968- timeout = 20 ,
969- env = None ,
968+ timeout = 20.0 ,
969+ env = ANY ,
970970 username = None ,
971971 password = None ,
972972 is_binary = False ,
@@ -1068,8 +1068,8 @@ async def test_branch_success_rebasing():
10681068 "refs/heads/" ,
10691069 ],
10701070 cwd = str (Path ("/bin" ) / "test_curr_path" ),
1071- timeout = 20 ,
1072- env = None ,
1071+ timeout = 20.0 ,
1072+ env = ANY ,
10731073 username = None ,
10741074 password = None ,
10751075 is_binary = False ,
@@ -1078,8 +1078,8 @@ async def test_branch_success_rebasing():
10781078 call (
10791079 ["git" , "symbolic-ref" , "--short" , "HEAD" ],
10801080 cwd = str (Path ("/bin" ) / "test_curr_path" ),
1081- timeout = 20 ,
1082- env = None ,
1081+ timeout = 20.0 ,
1082+ env = ANY ,
10831083 username = None ,
10841084 password = None ,
10851085 is_binary = False ,
@@ -1088,8 +1088,8 @@ async def test_branch_success_rebasing():
10881088 call (
10891089 ["git" , "branch" , "-a" ],
10901090 cwd = str (Path ("/bin" ) / "test_curr_path" ),
1091- timeout = 20 ,
1092- env = None ,
1091+ timeout = 20.0 ,
1092+ env = ANY ,
10931093 username = None ,
10941094 password = None ,
10951095 is_binary = False ,
@@ -1103,8 +1103,8 @@ async def test_branch_success_rebasing():
11031103 "refs/remotes/" ,
11041104 ],
11051105 cwd = str (Path ("/bin" ) / "test_curr_path" ),
1106- timeout = 20 ,
1107- env = None ,
1106+ timeout = 20.0 ,
1107+ env = ANY ,
11081108 username = None ,
11091109 password = None ,
11101110 is_binary = False ,
0 commit comments