Merge "ensure the independent series always shows up in the status set"

This commit is contained in:
Zuul 2018-04-25 20:39:43 +00:00 committed by Gerrit Code Review
commit 796f75dcf8
2 changed files with 12 additions and 0 deletions

View File

@ -57,6 +57,13 @@ class SeriesStatus(collections.abc.Mapping):
def __init__(self, raw_data):
self._raw_data = raw_data
self._data = self._organize_data(raw_data)
# Ensure there is always an independent series.
if 'independent' not in self._data:
self._data['independent'] = Series({
'name': 'independent',
'status': 'development',
'initial-release': None,
})
@classmethod
def from_directory(cls, root_dir):

View File

@ -59,6 +59,11 @@ class TestConstructSeriesStatus(base.BaseTestCase):
status = series_status.SeriesStatus.from_directory(self.tmpdir)
self.assertIn('rocky', status)
def test_independent_series(self):
data = yamlutils.loads(self._body)
status = series_status.SeriesStatus(data)
self.assertIn('independent', status)
class TestSeries(base.BaseTestCase):