예제 #1
0
    def test_nonexistant_file(self):
        self.section.append(Setting("language", "bullshit"))

        with self.assertRaises(KeyError):
            LanguageDefinition.from_section(self.section)

        self.section.append(Setting("language_family", "bullshit"))
        with self.assertRaises(FileNotFoundError):
            LanguageDefinition.from_section(self.section)
예제 #2
0
    def test_nonexistant_file(self):
        self.section.append(Setting("language", "bullshit"))

        with self.assertRaises(KeyError):
            LanguageDefinition.from_section(self.section)

        self.section.append(Setting("language_family", "bullshit"))
        with self.assertRaises(FileNotFoundError):
            LanguageDefinition.from_section(self.section)
예제 #3
0
 def test_key_contains(self):
     uut = LanguageDefinition.from_section(self.section)
     self.assertIn('extensions', uut)
     self.assertNotIn('randomstuff', uut)
예제 #4
0
 def test_loading(self):
     uut = LanguageDefinition.from_section(self.section)
     self.assertEqual(list(uut["extensions"]), [".c", ".cpp", ".h", ".hpp"])
예제 #5
0
 def test_key_contains(self):
     uut = LanguageDefinition.from_section(self.section)
     self.assertIn('extensions', uut)
     self.assertNotIn('randomstuff', uut)
예제 #6
0
 def test_loading(self):
     uut = LanguageDefinition.from_section(self.section)
     self.assertEqual(list(uut["extensions"]), [".c", ".cpp", ".h", ".hpp"])