Пример #1
0
    def test_loader_from_file(self):
        loader = SetLoader()
        self.assertIsNotNone(loader)

        the_set = loader.load_file_contents(os.path.dirname(__file__)+ "/test_files/sets/test_set.txt")
        self.assertIsNotNone(the_set)

        self.assertIn("ALABAMA", the_set)
        self.assertIn("ALASKA", the_set)
        self.assertIn("KANSAS", the_set)
        self.assertIn("KENTUCKY", the_set)
        self.assertNotIn("London", the_set)
Пример #2
0
    def test_loader_from_file(self):
        loader = SetLoader()
        self.assertIsNotNone(loader)

        the_set = loader.load_file_contents(os.path.dirname(__file__)+ "/test_files/sets/test_set.txt")
        self.assertIsNotNone(the_set)
        self.assertEqual(len(the_set), 17)

        self.assertIn("ALABAMA", the_set)
        self.assertEqual("Alabama", the_set['ALABAMA'])
        self.assertIn("ALASKA", the_set)
        self.assertIn("KANSAS", the_set)
        self.assertIn("KENTUCKY", the_set)
        self.assertNotIn("London", the_set)
Пример #3
0
    def test_loader_from_file(self):
        loader = SetLoader()
        self.assertIsNotNone(loader)

        the_set = loader.load_file_contents(
            "/Users/keithsterling/Documents/Development/Python/Projects/AIML/program-y/src/test/mappings/test_files/sets/test_set.txt"
        )
        self.assertIsNotNone(the_set)

        self.assertIn("ALABAMA", the_set)
        self.assertIn("ALASKA", the_set)
        self.assertIn("KANSAS", the_set)
        self.assertIn("KENTUCKY", the_set)
        self.assertNotIn("London", the_set)
Пример #4
0
    def test_loader_from_file(self):
        loader = SetLoader()
        self.assertIsNotNone(loader)

        the_set = loader.load_file_contents(
            os.path.dirname(__file__) + "/test_files/sets/test_set.txt")
        self.assertIsNotNone(the_set)
        self.assertEqual(len(the_set), 451)

        self.assertIn("AMBER", the_set)
        self.assertEqual([["Amber"]], the_set['AMBER'])

        self.assertIn("RED", the_set)
        self.assertEqual(
            [['Red', 'brown'], ['Red', 'Orange'], ['Red', 'violet'], ['Red']],
            the_set["RED"])

        self.assertNotIn("London", the_set)