Exemplo n.º 1
0
 def test_load_from_file(self):
     config = JSONConfigurationFile()
     self.assertIsNotNone(config)
     configuration = config.load_from_file(
         os.path.dirname(__file__) + os.sep + "test_json.json",
         ConsoleConfiguration(), ".")
     self.assertIsNotNone(configuration)
     self.assert_configuration(configuration)
Exemplo n.º 2
0
 def test_load_from_file(self):
     json = JSONConfigurationFile()
     self.assertIsNotNone(json)
     configuration = json.load_from_file(
         os.path.dirname(__file__) + "/test_json.json",
         ConsoleConfiguration(), ".")
     self.assertIsNotNone(configuration)
     self.assert_configuration(configuration)
Exemplo n.º 3
0
    def test_load_from_file(self):
        json = JSONConfigurationFile()
        self.assertIsNotNone(json)

        text_file = os.path.dirname(__file__) + os.sep + "test_json.json"

        configuration = json.load_from_file(text_file, ConsoleConfiguration(),
                                            ".")
        self.assertIsNotNone(configuration)
        self.assert_configuration(configuration)
Exemplo n.º 4
0
    def test_load_from_file(self):
        client_config = ClientConfiguration()
        json = JSONConfigurationFile(client_config)
        self.assertIsNotNone(json)
        json.load_from_file(os.path.dirname(__file__) + "/test_json.json", ",")
        self.assertIsNotNone(json.json_data)
        brain = json.get_section("brain")
        self.assertIsNotNone(brain)
        files = json.get_section("files", brain)
        self.assertIsNotNone(files)
        aiml = json.get_section("aiml", files)
        self.assertIsNotNone(aiml)

        files = json.get_section("files", aiml)
        self.assertIsNotNone(files)
        self.assertEqual(files, "/aiml")
        extension = json.get_section("extension", aiml)
        self.assertIsNotNone(extension)
        self.assertEqual(extension, ".aiml")
        directories = json.get_section("directories", aiml)
        self.assertIsNotNone(directories)
        self.assertEqual(directories, True)
Exemplo n.º 5
0
 def test_invalid_file(self):
     config = JSONConfigurationFile()
     self.assertIsNotNone(
         config.load_from_file("unknown.json", ConsoleConfiguration(), "."))