Add missing tests for db.block_device_mapping_* methods
There was no tests in test_db_api for block_device_mapping_* methods. Add tests to ensure that all works. Also these tests allow us to refactor work with session in these methods. Fix bug in is_ephemeral we should return True or False not instance of _sre.SRE_Match or None. blueprint db-api-tests Change-Id: I3cac17e7d2c8d0b2608fb9a78ea29210f025222b
This commit is contained in:
@@ -52,7 +52,7 @@ _ephemeral = re.compile('^ephemeral(\d|[1-9]\d+)$')
|
||||
|
||||
|
||||
def is_ephemeral(device_name):
|
||||
return _ephemeral.match(device_name)
|
||||
return _ephemeral.match(device_name) is not None
|
||||
|
||||
|
||||
def ephemeral_num(ephemeral_name):
|
||||
|
||||
Reference in New Issue
Block a user