def test_repr_with_strings(self, mock_parse): mock_parse.return_value = ('abc', 'def') v = cbase.Version('test', mock.ANY, mock.ANY) result = "%s" % v self.assertEqual('abc.def', result)
def max_version(): return base.Version( {base.Version.string: versions.max_version_string()}, versions.min_version_string(), versions.max_version_string())
def test_repr(self, mock_parse): mock_parse.return_value = (123, 456) v = cbase.Version('test', mock.ANY, mock.ANY) result = "%s" % v self.assertEqual('123.456', result)
from wsme import types as wtypes from ironic.api.controllers import base from ironic.api.controllers import link from ironic.api.controllers.v1 import chassis from ironic.api.controllers.v1 import driver from ironic.api.controllers.v1 import node from ironic.api.controllers.v1 import port from ironic.api.controllers.v1 import versions from ironic.api import expose from ironic.common.i18n import _ BASE_VERSION = versions.BASE_VERSION MIN_VER = base.Version({base.Version.string: versions.MIN_VERSION_STRING}, versions.MIN_VERSION_STRING, versions.MAX_VERSION_STRING) MAX_VER = base.Version({base.Version.string: versions.MAX_VERSION_STRING}, versions.MIN_VERSION_STRING, versions.MAX_VERSION_STRING) class MediaType(base.APIBase): """A media type representation.""" base = wtypes.text type = wtypes.text def __init__(self, base, type): self.base = base self.type = type