+ def test_watchrepo(self, margebot, gitlab):
+ margebot.push_message('!watchrepo group/new_repo room1,room2,room3')
+ pm = margebot.pop_message()
+ assert 'Now watching for new MRs in the group/new_repo repo to the room1,room2,room3 room(s)' in pm
+ assert 'No open MRs were found in the repo.' in pm
+
+ def test_watchrepo_already_watching_repo(self, margebot, gitlab_already_watching):
+ margebot.push_message('!watchrepo group/new_repo room1,room2,room3')
+ pm = margebot.pop_message()
+ assert 'Already reporting group/new_repo MRs to the room1,room2,room3 room(s)' in pm
+
+ def test_watchrepo_updating_roomlist(self, margebot, gitlab_already_watching):
+ margebot.push_message('!watchrepo group/new_repo room4,room5,room6')
+ pm = margebot.pop_message()
+ assert 'Updating room list for group/new_repo MRs from room1,room2,room3 to room4,room5,room6' in pm
+
+# @pytest.mark.skip(reason='until I figure out how to mock MargeGitlab')
+ def test_watchrepo_existing_mr(self, margebot, gitlab_one_review):
+ margebot.push_message('!watchrepo sample/mr room1,room2,room3')
+ pm = margebot.pop_message()
+ assert 'Now watching for new MRs in the sample/mr repo to the room1,room2,room3 room(s)' in pm
+ assert '1 open MR was found in the repo.' in pm
+