Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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)