Commit 5501202f authored by Cyril Roelandt's avatar Cyril Roelandt
Browse files

upt.ArchiveType: add RUBYGEM.

parent a9871932
......@@ -7,6 +7,7 @@ Based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Changed
- cli: --frontend/--backend is optional when there is only one
frontend/backend available
- ArchiveType: add type "RUBYGEM"
## [0.7] - 2019-04-28
### Added
......
......@@ -30,6 +30,15 @@ class TestPackage(unittest.TestCase):
pkg = upt.Package('foo', '4.2', archives=archives)
self.assertEqual(pkg.get_archive(), archives[0])
def test_get_archive_with_argument(self):
archives = [
upt.Archive('url', archive_type=upt.ArchiveType.RUBYGEM)
]
pkg = upt.Package('foo', '4.2', archives=archives)
with self.assertRaises(upt.ArchiveUnavailable):
pkg.get_archive()
self.assertEqual(pkg.get_archive(upt.ArchiveType.RUBYGEM), archives[0])
@mock.patch('os.remove')
def test_clean_archive_downloaded(self, remove_fn):
archives = [
......
......@@ -27,6 +27,7 @@ class Frontend(object):
class ArchiveType(Enum):
SOURCE_TARGZ = 1
RUBYGEM = 2
class ArchiveUnavailable(Exception):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment