Merge #390 checksums: Never skip checksumming phase
This commit is contained in:
commit
8d1b4dea17
@ -25,6 +25,13 @@ class ImageChecksumPhase(PhaseBase):
|
|||||||
self.checksums = self.compose.conf['media_checksums']
|
self.checksums = self.compose.conf['media_checksums']
|
||||||
self.one_file = self.compose.conf['media_checksum_one_file']
|
self.one_file = self.compose.conf['media_checksum_one_file']
|
||||||
|
|
||||||
|
def skip(self):
|
||||||
|
# Skipping this phase does not make sense:
|
||||||
|
# * if there are no images, it doesn't do anything and is quick
|
||||||
|
# * if there are images, they must have checksums computed or else
|
||||||
|
# writing metadata will fail
|
||||||
|
return False
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
errors = []
|
errors = []
|
||||||
try:
|
try:
|
||||||
|
@ -20,6 +20,11 @@ from tests.helpers import DummyCompose, PungiTestCase
|
|||||||
|
|
||||||
class TestImageChecksumPhase(PungiTestCase):
|
class TestImageChecksumPhase(PungiTestCase):
|
||||||
|
|
||||||
|
def test_phase_is_never_skipped(self):
|
||||||
|
compose = DummyCompose(self.topdir, {})
|
||||||
|
phase = ImageChecksumPhase(compose)
|
||||||
|
self.assertFalse(phase.skip())
|
||||||
|
|
||||||
def test_config_skip_individual_with_multiple_algorithms(self):
|
def test_config_skip_individual_with_multiple_algorithms(self):
|
||||||
compose = DummyCompose(self.topdir, {
|
compose = DummyCompose(self.topdir, {
|
||||||
'media_checksums': ['md5', 'sha1'],
|
'media_checksums': ['md5', 'sha1'],
|
||||||
|
Loading…
Reference in New Issue
Block a user