예제 #1
0
    def get_nonexistant_file_resource(self, path):
        contents = "text = Arise, awake and do not stop until the goal is reached."

        source_path = create_named_tempfile(
            contents, prefix="strings", suffix=".ftl", directory=self.tempdir,
        )
        source_resource = ftl.FTLResource(
            path=source_path, locale=None, source_resource=None
        )

        return ftl.FTLResource(path, locale=None, source_resource=source_resource,)
예제 #2
0
 def test_init_missing_resource(self):
     """
     If the FTLResource file doesn't exist and no source resource is
     given, raise a IOError.
     """
     path = self.get_nonexistant_file_path()
     with assert_raises(IOError):
         ftl.FTLResource(path, locale=None, source_resource=None)