def test_alert_maintainers(qisrc_action, git_server):
    foo_repo = git_server.create_repo("foo.git", review=True)
    qiproject_xml = """\
<project format="3">
  <maintainer email="jdoe@company.com">John Doe</maintainer>
</project>"""
    git_server.push_file("foo.git", "qiproject.xml", qiproject_xml)
    qisrc_action("init", git_server.manifest_url)
    git_worktree = TestGitWorkTree()
    foo_proj = git_worktree.get_git_project("foo")
    foo_git = TestGit(foo_proj.path)
    # Need to fetch gerrit remote at least once for gerrit/master to exist
    foo_git.fetch("--all")
    foo_git.commit_file("a.txt", "a")
    with mock.patch.object(qisys.command, "call") as mocked_call:
        qisrc_action("push", "--project", "foo")
    set_reviewers_args =  mocked_call.call_args_list[-1][0][0][-1] # Last argument of last command
    assert "jdoe" in set_reviewers_args
    assert not "@company.com" in set_reviewers_args
dataset/ETHPy150Open aldebaran/qibuild/python/qisrc/test/test_qisrc_push.py/test_alert_maintainers/original