diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /python/mozversioncontrol/test/test_get_mozilla_remote_args.py | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'python/mozversioncontrol/test/test_get_mozilla_remote_args.py')
-rw-r--r-- | python/mozversioncontrol/test/test_get_mozilla_remote_args.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/python/mozversioncontrol/test/test_get_mozilla_remote_args.py b/python/mozversioncontrol/test/test_get_mozilla_remote_args.py new file mode 100644 index 0000000000..0d6872b642 --- /dev/null +++ b/python/mozversioncontrol/test/test_get_mozilla_remote_args.py @@ -0,0 +1,47 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +import mozunit + +from mozversioncontrol import get_repository_object + +STEPS = { + "hg": [], + "git": [ + "git remote add blah https://example.com/blah", + """ + git remote add unified hg::https://hg.mozilla.org/mozilla-unified + git remote add central hg::https://hg.mozilla.org/central + git remote add try hg::https://hg.mozilla.org/try + """, + ], +} + + +def test_get_upstream_remotes(repo): + # Test is only relevant for Git. + if not repo.vcs == "git": + return + + repo.execute_next_step() + + vcs = get_repository_object(repo.dir) + remotes = vcs.get_mozilla_remote_args() + + assert remotes == [ + "--remotes" + ], "Default `--remotes` passed without finding official remote." + + repo.execute_next_step() + + remotes = sorted(vcs.get_mozilla_remote_args()) + + assert remotes == [ + "--remotes=central", + "--remotes=unified", + ], "Multiple non-try remote arguments should be found." + + +if __name__ == "__main__": + mozunit.main() |