aboutsummaryrefslogtreecommitdiff
path: root/tests/component
diff options
context:
space:
mode:
Diffstat (limited to 'tests/component')
-rw-r--r--tests/component/__init__.py4
-rw-r--r--tests/component/deb/__init__.py1
-rw-r--r--tests/component/deb/test_import_orig.py21
3 files changed, 23 insertions, 3 deletions
diff --git a/tests/component/__init__.py b/tests/component/__init__.py
index 5850803..013550e 100644
--- a/tests/component/__init__.py
+++ b/tests/component/__init__.py
@@ -25,6 +25,7 @@ import os
import shutil
import tempfile
import unittest
+from unittest import skipUnless
from nose import SkipTest
from nose.tools import eq_, ok_ # pylint: disable=E0611
from .. testutils import GbpLogTester
@@ -32,6 +33,9 @@ from .. testutils import GbpLogTester
from gbp.git import GitRepository, GitRepositoryError
+__all__ = ['ComponentTestGitRepository', 'ComponentTestBase', 'GbpLogTester', 'skipUnless']
+
+
class ComponentTestGitRepository(GitRepository):
"""Git repository class for component tests"""
def submodule_status(self):
diff --git a/tests/component/deb/__init__.py b/tests/component/deb/__init__.py
index 030a482..65486e8 100644
--- a/tests/component/deb/__init__.py
+++ b/tests/component/deb/__init__.py
@@ -23,6 +23,7 @@ from tests.component import ComponentTestGitRepository
DEB_TEST_SUBMODULE = os.path.join('tests', 'component', 'deb', 'data')
DEB_TEST_DATA_DIR = os.path.abspath(DEB_TEST_SUBMODULE)
+DEB_TEST_DOWNLOAD_URL = 'https://git.sigxcpu.org/cgit/gbp/deb-testdata/plain/'
def setup():
diff --git a/tests/component/deb/test_import_orig.py b/tests/component/deb/test_import_orig.py
index c4e1bad..d4329fe 100644
--- a/tests/component/deb/test_import_orig.py
+++ b/tests/component/deb/test_import_orig.py
@@ -21,8 +21,9 @@ import os
from mock import patch, DEFAULT
from tests.component import (ComponentTestBase,
- ComponentTestGitRepository)
-from tests.component.deb import DEB_TEST_DATA_DIR
+ ComponentTestGitRepository,
+ skipUnless)
+from tests.component.deb import DEB_TEST_DATA_DIR, DEB_TEST_DOWNLOAD_URL
from gbp.scripts.import_dsc import main as import_dsc
from gbp.scripts.import_orig import main as import_orig
@@ -43,7 +44,6 @@ def raise_if_tag_match(match):
class TestImportOrig(ComponentTestBase):
"""Test importing of new upstream versions"""
-
pkg = "hello-debhelper"
def_branches = ['master', 'upstream', 'pristine-tar']
@@ -52,6 +52,11 @@ class TestImportOrig(ComponentTestBase):
dir,
'%s_%s.orig.tar.gz' % (self.pkg, version))
+ def _download_url(self, version, dir='dsc-3.0'):
+ return os.path.join(DEB_TEST_DOWNLOAD_URL,
+ dir,
+ '%s_%s.orig.tar.gz' % (self.pkg, version))
+
def _dsc(self, version, dir='dsc-3.0'):
return os.path.join(DEB_TEST_DATA_DIR,
dir,
@@ -66,6 +71,16 @@ class TestImportOrig(ComponentTestBase):
self._check_repo_state(repo, 'master', self.def_branches,
tags=['upstream/2.6'])
+ @skipUnless(os.getenv("GBP_NETWORK_TESTS"), "network tests disabled")
+ def test_download(self):
+ """Test that importing via download works"""
+ repo = GitRepository.create(self.pkg)
+ os.chdir(self.pkg)
+ orig = self._download_url('2.6')
+ ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 0)
+ self._check_repo_state(repo, 'master', self.def_branches,
+ tags=['upstream/2.6'])
+
def test_update(self):
"""
Test that importing a new version works