functional: Grab the service version from the module

This way we avoid having to change the test template every time we bump
the version, it will be taken from the module.

Change-Id: I699b737e0e234f0649f6d207a648c60d74d9701e
This commit is contained in:
Nikola Dipanov 2016-02-26 17:27:31 +00:00
parent 791e5421cd
commit d411d60587
2 changed files with 4 additions and 1 deletions

View File

@ -13,7 +13,7 @@
"disabled_reason": null,
"report_count": 1,
"forced_down": false,
"version": 8
"version": %(current_service_version)s
}
},
"event_type": "service.update",

View File

@ -16,6 +16,7 @@ import os
from oslo_serialization import jsonutils
from nova.objects import service as service_obj
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.unit import fake_notifier
@ -85,6 +86,8 @@ class NotificationSampleTestBase(test.TestCase):
with open(self._get_notification_sample(sample_file_name)) as sample:
sample_data = sample.read()
sample_data = sample_data % {
"current_service_version": service_obj.SERVICE_VERSION}
sample_obj = jsonutils.loads(sample_data)
self._apply_replacements(replacements, sample_obj)