Example #1
0
    def test_bad_config_file(self):
        with io.open(self.NOT_A_DICT, encoding='utf-8') as yamlfile:
            conf._flags.config_file = yamlfile
            with self.assertRaises(conf.ConfigurationInvalidError):
                conf.reset()

        with io.open(self.BAD_FORMAT, encoding='utf-8') as yamlfile:
            conf._flags.config_file = yamlfile
            with self.assertRaises(conf.ConfigurationInvalidError):
                conf.reset()
Example #2
0
  def test_bad_config_file(self):
    with open(self.NOT_A_DICT, 'rb') as yamlfile:
      conf._flags.config_file = yamlfile
      with self.assertRaises(conf.ConfigurationInvalidError):
        conf.reset()

    with open(self.BAD_FORMAT, 'rb') as yamlfile:
      conf._flags.config_file = yamlfile
      with self.assertRaises(conf.ConfigurationInvalidError):
        conf.reset()
Example #3
0
 def test_yaml_config(self):
     with io.open(self.YAML_FILENAME, encoding='utf-8') as yamlfile:
         conf._flags.config_file = yamlfile
         conf.reset()
     self.assertEqual('yaml_test_value', conf.yaml_test_key)
Example #4
0
 def tearDown(self):
     conf._flags.config_file = None
     conf.reset()
Example #5
0
 def test_yaml_config(self):
     with open(self.YAML_FILENAME, 'rb') as yamlfile:
         conf._flags.config_file = yamlfile
         conf.reset()
     self.assertEquals('yaml_test_value', conf.yaml_test_key)
Example #6
0
 def test_yaml_config(self):
   with open(self.YAML_FILENAME, 'rb') as yamlfile:
     conf._flags.config_file = yamlfile
     conf.reset()
   self.assertEqual('yaml_test_value', conf.yaml_test_key)
Example #7
0
 def tearDown(self):
   conf._flags.config_file = None
   conf.reset()
Example #8
0
 def tearDown(self):
     conf._flags.config_file = None
     conf.reset()
     super(TestConf, self).tearDown()