File tree Expand file tree Collapse file tree 5 files changed +30
-2
lines changed
Expand file tree Collapse file tree 5 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 1+ initialization :
2+ steps :
3+ - type : commit
4+ empty : true
5+ message : Empty commit
6+ id : start
7+ - type : remote
8+ remote-url : git@github.com/git-mastery/link-me.git
9+ remote-name : upstream
Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ initialization:
55 message : Empty commit
66 id : start
77 - type : remote
8- remote-url : https://github.com/git-mastery/link-me
8+ remote-url : https://github.com/git-mastery/link-me.git
99 remote-name : upstream
Original file line number Diff line number Diff line change 1+ initialization :
2+ steps :
3+ - type : commit
4+ empty : true
5+ message : Empty commit
6+ id : start
7+ - type : remote
8+ remote-url : git@github.com:git-mastery/link-me.git
9+ remote-name : upstream
Original file line number Diff line number Diff line change @@ -12,6 +12,16 @@ def test_valid():
1212 assert_output (output , GitAutograderStatus .SUCCESSFUL )
1313
1414
15+ def test_valid_ssh ():
16+ with loader .load ("specs/valid_ssh.yml" , "start" ) as output :
17+ assert_output (output , GitAutograderStatus .SUCCESSFUL )
18+
19+
20+ def test_invalid_ssh ():
21+ with loader .load ("specs/invalid_ssh.yml" , "start" ) as output :
22+ assert_output (output , GitAutograderStatus .UNSUCCESSFUL , [WRONG_UPSTREAM_URL ])
23+
24+
1525def test_wrong_url ():
1626 with loader .load ("specs/wrong_url.yml" , "start" ) as output :
1727 assert_output (output , GitAutograderStatus .UNSUCCESSFUL , [WRONG_UPSTREAM_URL ])
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def verify(exercise: GitAutograderExercise) -> GitAutograderOutput:
1313 raise exercise .wrong_answer ([MISSING_UPSTREAM_REMOTE ])
1414
1515 upstream = exercise .repo .remotes .remote ("upstream" )
16- if not upstream .remote . url . startswith ( "https://github.com/ git-mastery/ link-me" ):
16+ if not upstream .is_for_repo ( " git-mastery" , " link-me" ):
1717 raise exercise .wrong_answer ([WRONG_UPSTREAM_URL ])
1818
1919 return exercise .to_output (
You can’t perform that action at this time.
0 commit comments