def testGetHostnamePrefixSpecificVersionAndModule(self): with mock.patch('{0}.get_current_version_name'.format(MODULES_MODULE), return_value='devversion'): with mock.patch('{0}.get_default_version'.format(MODULES_MODULE), return_value='v1'): with mock.patch('{0}.get_current_module_name'.format(MODULES_MODULE), return_value='devmodule'): result = util.get_hostname_prefix() self.assertEqual('devversion-dot-devmodule-dot-', result)
def testGetHostnamePrefixAllDefault(self): with mock.patch('{0}.get_current_version_name'.format(MODULES_MODULE), return_value='v1'): with mock.patch('{0}.get_default_version'.format(MODULES_MODULE), return_value='v1'): with mock.patch('{0}.get_current_module_name'.format(MODULES_MODULE), return_value='default'): result = util.get_hostname_prefix() self.assertEqual('', result)
def testGetHostnamePrefixSpecificVersionAndModule(self): with mock.patch('{0}.get_current_version_name'.format(MODULES_MODULE), return_value='devversion'): with mock.patch('{0}.get_default_version'.format(MODULES_MODULE), return_value='v1'): with mock.patch( '{0}.get_current_module_name'.format(MODULES_MODULE), return_value='devmodule'): result = util.get_hostname_prefix() self.assertEqual('devversion-dot-devmodule-dot-', result)
def testGetHostnamePrefixAllDefault(self): with mock.patch('{0}.get_current_version_name'.format(MODULES_MODULE), return_value='v1'): with mock.patch('{0}.get_default_version'.format(MODULES_MODULE), return_value='v1'): with mock.patch( '{0}.get_current_module_name'.format(MODULES_MODULE), return_value='default'): result = util.get_hostname_prefix() self.assertEqual('', result)