aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-01-19 11:46:30 +0100
committerGuido Günther <agx@sigxcpu.org>2017-01-19 11:46:51 +0100
commitb863399aa94e5ec4cdd7c60f131fb229b8f3b7b0 (patch)
tree411f4f86da196d8f562ad95e00b9dd46a4d2bb3b /tests
parent588b70c21ee5a30620aa9d2f3ef646e456e8dce3 (diff)
pull: Allow to specify remote on the command line
Closes: #851844
Diffstat (limited to 'tests')
-rw-r--r--tests/component/deb/test_pull.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/component/deb/test_pull.py b/tests/component/deb/test_pull.py
new file mode 100644
index 0000000..80f6fe6
--- /dev/null
+++ b/tests/component/deb/test_pull.py
@@ -0,0 +1,52 @@
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from tests.component import (ComponentTestBase,
+ ComponentTestGitRepository)
+from tests.component.deb.fixtures import RepoFixtures
+
+from nose.tools import eq_
+
+from gbp.scripts.clone import main as clone
+from gbp.scripts.pull import main as pull
+
+
+class TestPull(ComponentTestBase):
+ """Test cloning from a remote"""
+
+ @RepoFixtures.native
+ def test_pull_explicit_remote(self, repo):
+ """Test that pulling of debian native packages works"""
+ dest = os.path.join(self._tmpdir, 'cloned_repo')
+ clone(['arg0', repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'master', ['master'])
+ eq_(pull(['argv0', 'origin']), 0)
+ assert len(repo.get_commits()) == 1
+
+ @RepoFixtures.native
+ def test_pull_default_remote(self, repo):
+ """Test that pulling of debian native packages works"""
+ dest = os.path.join(self._tmpdir, 'cloned_repo')
+ clone(['arg0', repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'master', ['master'])
+ eq_(pull(['argv0']), 0)
+ assert len(repo.get_commits()) == 1