This repository was archived by the owner on Mar 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ def get_repo_configs():
75
75
"reviewers" : ["@JohnTitor" ],
76
76
}
77
77
}
78
+ },
79
+ 'teams' : {
80
+ "groups" : {"all" : [], "a" : ["@pnkfelix" ], "b/c" : ["@nrc" ]}
78
81
}
79
82
}
80
83
Original file line number Diff line number Diff line change @@ -1260,6 +1260,31 @@ def test_mentions_without_dirs(self):
1260
1260
)
1261
1261
assert set (["@JohnTitor" ]) == mentions
1262
1262
1263
+ def test_with_team_ping (self ):
1264
+ """Test choosing a reviewer when passed a team ping"""
1265
+ handler = HighfiveHandlerMock (
1266
+ Payload ({}), repo_config = self .fakes ['config' ]['teams' ]
1267
+ ).handler
1268
+
1269
+ found_cases = (
1270
+ ("r? @foo/a" , "pnkfelix" ),
1271
+ ("r? @b/c" , "nrc" ),
1272
+ )
1273
+
1274
+ not_found_cases = (
1275
+ "r? @/a" ,
1276
+ "r? @a/b" ,
1277
+ )
1278
+
1279
+ for (msg , reviewer ) in found_cases :
1280
+ assert handler .find_reviewer (msg , None ) == reviewer , \
1281
+ "expected '%s' from '%s'" % (reviewer , msg )
1282
+
1283
+ for msg in not_found_cases :
1284
+ assert handler .find_reviewer (msg , None ) is None , \
1285
+ "expected '%s' to have no reviewer extracted" % msg
1286
+
1287
+
1263
1288
class TestRun (TestNewPR ):
1264
1289
@pytest .fixture (autouse = True )
1265
1290
def make_mocks (cls , patcherize ):
You can’t perform that action at this time.
0 commit comments