Example #1
0
    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()
Example #2
0
 def testUnknown(self):
     with self.assertRaises(settings_utils.UnknownEnvironment):
         settings_utils.CurrentEnvironment()
Example #3
0
 def testHostnameCheck(self):
     os.environ['DEFAULT_VERSION_HOSTNAME'] = settings.ProdEnv.HOSTNAME
     self.assertEqual(settings.ProdEnv, settings_utils.CurrentEnvironment())
Example #4
0
 def testHostnameCheck_Unknown(self):
     os.environ['DEFAULT_VERSION_HOSTNAME'] = 'something_else'
     with self.assertRaises(settings_utils.UnknownEnvironment):
         settings_utils.CurrentEnvironment()
Example #5
0
def ENV():
  return settings_utils.CurrentEnvironment()