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:
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user