예제 #1
0
    def test_default_settings_exist(self):
        enable_database = ons_env.get('enable_database', boolean=True)
        print(">>>", enable_database)
        self.assertFalse(enable_database)

        drop_database = ons_env.get('drop_database', boolean=True)
        self.assertTrue(drop_database)

        self.assertTrue(ons_env.drop_database)
예제 #2
0
 def test_get_flask_port(self):
     self.assertEqual(ons_env.get('flask_port', 123), 123)
예제 #3
0
 def test_get_flask_host(self):
     self.assertEqual(ons_env.get('flask_host', 'localhost'), 'localhost')
예제 #4
0
 def test_get_flask_protocol(self):
     self.assertEqual(ons_env.get('flask_protocol'), 'http')
예제 #5
0
 def test_using_env_to_override_config_options(self):
     environ['MY_ENV_KEY'] = 'HELLO'
     test = ons_env.get('MY_ENV_KEY')
     self.assertEqual(test, 'HELLO')
예제 #6
0
 def test_get_on_non_section(self):
     test = ons_env.get('this_is_new', 'HELLO', 'NO SECTION')
     self.assertEqual(test, 'HELLO')
예제 #7
0
 def test_set_a_random_variable(self):
     ons_env.set('this_is_new', 'HELLO')
     hello = ons_env.get('this_is_new')
     self.assertEqual(hello, 'HELLO')