示例#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)
示例#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)
示例#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)
示例#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)
示例#5
0
 def test_invalid_file(self):
     config = JSONConfigurationFile()
     self.assertIsNotNone(
         config.load_from_file("unknown.json", ConsoleConfiguration(), "."))