def test_parse_with_no_source_path(self): contents = "text = Arise, awake and do not stop until the goal is reached." path = create_named_tempfile( contents, prefix="strings", suffix=".ftl", directory=self.tempdir, ) obj = ftl.parse(path, source_path=None, locale=None) assert obj.path == path assert obj.source_resource is None assert obj.locale is None
def test_parse_with_source_path(self): 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, ) path = self.get_nonexistant_file_path() obj = ftl.parse(path, source_path=source_path, locale=None) assert_equal(obj.path, path) assert_equal(obj.locale, None) assert_equal(obj.source_resource.path, source_path) assert_equal(obj.source_resource.locale, None)
def test_parse_with_no_source_path(self): contents = "text = Arise, awake and do not stop until the goal is reached." path = create_named_tempfile( contents, prefix='strings', suffix='.ftl', directory=self.tempdir, ) obj = ftl.parse(path, source_path=None, locale=None) assert_equal(obj.path, path) assert_equal(obj.source_resource, None) assert_equal(obj.locale, None)