ensure the independent series always shows up in the status set

Change-Id: Id9fc9b600a1eeb3e5d7808ed587adfa0bf8f64df
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann
2018-04-20 11:36:43 -04:00
parent 276f13c72e
commit 92e2de953e
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):