Esempio n. 1
0
    def setUp(self):
        self.config = {}
        self.config_dir = tempfile.TemporaryDirectory()

        os.environ['CONFIG_DIR'] = self.config_dir.name

        self.write_config()

        Config._full_reload()
Esempio n. 2
0
    def write_config(self):
        with open(os.path.join(self.config_dir.name, 'application.yaml'), 'w') as handler:
            handler.write(yaml.dump(self.config, default_flow_style = False))

        Config._full_reload()
Esempio n. 3
0
 def test_no_file(self):
     os.environ['CONFIG_DIR'] = os.path.join(self.config_dir.name, 'not_a_dir')
     expect(
         lambda: Config._full_reload()
     ).not_to(raise_error)