def _build_test_link(self, language: LanguageCollection, letter: str) -> InlineText:
"""
A helper method which creates a link to the test file for a given language collection.
:param LanguageCollection language: a language collection
:param str letter: the first letter of the language
:return: a markdown link to a test file if it exists; an empty string otherwise
"""
test_file_path = language.test_file_path
if test_file_path:
file_path = self.repo_url_base + letter + "/" + language.name() + "/" + os.path.basename(test_file_path)
file_path_link = InlineText("Here", url=file_path)
else:
file_path_link = InlineText("")
return file_path_link
Ideally, I don't want the user poking at the underlying file structure anyway. Let's try to replicate the following line in a method:
The following code no longer works:
Ideally, I don't want the user poking at the underlying file structure anyway. Let's try to replicate the following line in a method:
This looks like the link to the test file in GitHub.