예제 #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()
예제 #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()
예제 #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)
예제 #4
0
 def tearDown(self):
     conf._flags.config_file = None
     conf.reset()
예제 #5
0
파일: conf_test.py 프로젝트: 141141/openhtf
 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)
예제 #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)
예제 #7
0
 def tearDown(self):
   conf._flags.config_file = None
   conf.reset()
예제 #8
0
 def tearDown(self):
     conf._flags.config_file = None
     conf.reset()
     super(TestConf, self).tearDown()