def testAppIdCheck(self): os.environ['APPLICATION_ID'] = settings.ProdEnv.PROJECT_ID self.assertEqual(settings.ProdEnv, settings_utils.CurrentEnvironment()) os.environ['APPLICATION_ID'] = 'something_else' with self.assertRaises(settings_utils.UnknownEnvironment): settings_utils.CurrentEnvironment()
def testUnknown(self): with self.assertRaises(settings_utils.UnknownEnvironment): settings_utils.CurrentEnvironment()
def testHostnameCheck(self): os.environ['DEFAULT_VERSION_HOSTNAME'] = settings.ProdEnv.HOSTNAME self.assertEqual(settings.ProdEnv, settings_utils.CurrentEnvironment())
def testHostnameCheck_Unknown(self): os.environ['DEFAULT_VERSION_HOSTNAME'] = 'something_else' with self.assertRaises(settings_utils.UnknownEnvironment): settings_utils.CurrentEnvironment()
def ENV(): return settings_utils.CurrentEnvironment()