def test_read_env_failure(self, mock_yaml):
     with patch('builtins.open', mock_open(), create=True):
         try:
             resDict, resLines = loadEnvFile('development',
                                             'config/{}.yaml')
         except YAMLError:
             pass
         self.assertRaises(YAMLError)
 def test_load_empty_env(self, mock_yaml):
     resDict, resLines = loadEnvFile('development', None)
     self.assertEqual(resDict, {})
 def test_load_env_config_success(self, mock_yaml):
     with patch('builtins.open', mock_open(), create=True):
         resDict, resLines = loadEnvFile('development', 'config/{}.yaml')
         self.assertTrue(resDict['testing'])
 def test_load_env_failure(self, mock_yaml):
     try:
         resDict, resLines = loadEnvFile('development', 'missing/{}.yaml')
     except FileNotFoundError:
         pass
     self.assertRaises(FileNotFoundError)
 def test_load_env_success(self, mock_yaml):
     resDict, resLines = loadEnvFile('development', None)
     self.assertTrue(resDict['testing'])
Exemplo n.º 6
0
 def test_read_env_failure(self, mock_yaml):
     try:
         resDict, resLines = loadEnvFile('development', 'config/{}.yaml')
     except YAMLError:
         pass
     self.assertRaises(YAMLError)
Exemplo n.º 7
0
 def test_load_env_config_success(self, mock_yaml):
     resDict, resLines = loadEnvFile('development', 'config/{}.yaml')
     self.assertTrue(resDict['testing'])
Exemplo n.º 8
0
 def test_load_empty_env(self, mock_yaml):
     resDict, resLines = loadEnvFile('development', None)
     assert resDict == {}
Exemplo n.º 9
0
 def test_load_env_failure(self, mock_yaml):
     with pytest.raises(FileNotFoundError):
         resDict, resLines = loadEnvFile('development', 'missing/{}.yaml')