def test_unpack_srpm(self): """Test unpacking of a source rpm""" srpm = SrcRpmFile(os.path.join(SRPM_DIR, 'gbp-test-1.0-1.src.rpm')) srpm.unpack(self.tmpdir) for fn in ['gbp-test-1.0.tar.bz2', 'foo.txt', 'bar.tar.gz', 'my.patch', 'my2.patch', 'my3.patch']: ok_(os.path.exists(os.path.join(self.tmpdir, fn)), "%s not found" % fn)
def setup(self): super(TestImportUnPacked, self).setup() # Unpack some source rpms os.mkdir('multi-unpack') for pkg in ['gbp-test-1.0-1.src.rpm', 'gbp-test2-2.0-0.src.rpm']: unpack_dir = pkg.replace('.src.rpm', '-unpack') os.mkdir(unpack_dir) pkg_path = os.path.join(DATA_DIR, pkg) SrcRpmFile(pkg_path).unpack(unpack_dir) SrcRpmFile(pkg_path).unpack('multi-unpack')
def test_srpm(self): """Test parsing of a source rpm""" srpm = SrcRpmFile(os.path.join(SRPM_DIR, 'gbp-test-1.0-1.src.rpm')) eq_(srpm.version, {'release': '1', 'upstreamversion': '1.0'}) eq_(srpm.name, 'gbp-test') eq_(srpm.upstreamversion, '1.0') eq_(srpm.packager, None)
def test_srpm(self): """Test parsing of a source rpm""" srpm = SrcRpmFile(os.path.join(SRPM_DIR, 'gbp-test-1.0-1.src.rpm')) assert srpm.version == {'release': '1', 'upstreamversion': '1.0'} assert srpm.name == 'gbp-test' assert srpm.upstreamversion == '1.0' assert srpm.packager is None
def test_srpm_2(self): """Test parsing of another source rpm""" srpm = SrcRpmFile(os.path.join(SRPM_DIR, 'gbp-test2-3.0-0.src.rpm')) eq_(srpm.version, { 'release': '0', 'upstreamversion': '3.0', 'epoch': '2' }) eq_(srpm.packager, 'Markus Lehtonen <*****@*****.**>')
def test_unpack_srpm(self): """Test unpacking of a source rpm""" srpm = SrcRpmFile(os.path.join(SRPM_DIR, "gbp-test-1.0-1.src.rpm")) srpm.unpack(self.tmpdir) for fn in ["gbp-test-1.0.tar.bz2", "foo.txt", "bar.tar.gz", "my.patch", "my2.patch", "my3.patch"]: ok_(os.path.exists(os.path.join(self.tmpdir, fn)), "%s not found" % fn)