Example #1
0
 def test_find_system_encoding(self):
     encoding = find.system_encoding()
     system = platform.system()
     if system in ('Linux', 'Darwin'):
         self.assertEqual(encoding, 'utf-8')
     else:
         self.assertGreater(len(encoding), 0)
Example #2
0
    def test_find_config_file_object_one(self):
        error_message = "The file '{0}' should have been loaded by the "\
                        "dodai.util.find.ConfigFile object."

        obj = find.ConfigFiles(find.config_directories(self._fixture.PROJECT),
                               find.system_encoding())
        files = obj(self._fixture.custom_filenames)
        for name in files:
            msg = error_message.format(name)
            self.assertTrue(name.name in self._fixture.good_filenames, msg=msg)
Example #3
0
    def test_find_config_file_object_three(self):
        error_message = "The file '{0}' should NOT have been loaded by the "\
                        "dodai.util.find.ConfigFile object"

        obj = find.ConfigFiles(find.config_directories(self._fixture.PROJECT),
                               find.system_encoding())
        files = obj(self._fixture.custom_filenames)

        loaded_files = []
        for name in files:
            loaded_files.append(name.name)

        for name in self._fixture.bogus_filenames:
            msg = error_message.format(name)
            self.assertFalse(name in loaded_files, msg=msg)