Esempio n. 1
0
 def test_guess_format_from_filename(self):
     config_format = ConfigurationFactory.guess_format_from_filename("file.yaml")
     self.assertEqual(config_format, "yaml")
     config_format = ConfigurationFactory.guess_format_from_filename("file.json")
     self.assertEqual(config_format, "json")
     config_format = ConfigurationFactory.guess_format_from_filename("file.xml")
     self.assertEqual(config_format, "xml")
Esempio n. 2
0
 def test_guess_format_from_filename(self):
     config_format = ConfigurationFactory.guess_format_from_filename(
         "file.yaml")
     self.assertEqual(config_format, "yaml")
     config_format = ConfigurationFactory.guess_format_from_filename(
         "file.json")
     self.assertEqual(config_format, "json")
     config_format = ConfigurationFactory.guess_format_from_filename(
         "file.xml")
     self.assertEqual(config_format, "xml")
Esempio n. 3
0
 def test_guess_format_no_extension(self):
     with self.assertRaises(Exception):
         ConfigurationFactory.guess_format_from_filename("file_yaml")
Esempio n. 4
0
 def test_guess_format_no_extension(self):
     with self.assertRaises(Exception):
         ConfigurationFactory.guess_format_from_filename("file_yaml")