Skip to content

Commit

Permalink
Fix link to Apache Airflow docs in webserver (apache#13250)
Browse files Browse the repository at this point in the history
  • Loading branch information
turbaszek authored Jan 24, 2021
1 parent 008b365 commit c90485c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion airflow/utils/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_docs_url(page: Optional[str] = None) -> str:
"http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/"
)
else:
result = f'https://airflow.apache.org/docs/{version.version}/'
result = f'https://airflow.apache.org/docs/apache-airflow/{version.version}/'
if page:
result = result + page
return result
12 changes: 8 additions & 4 deletions tests/utils/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ class TestGetDocsUrl(unittest.TestCase):
'http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/'
'apache-airflow/latest/migration.html',
),
('1.10.0', None, 'https://airflow.apache.org/docs/1.10.0/'),
('1.10.0', 'migration.html', 'https://airflow.apache.org/docs/1.10.0/migration.html'),
('1.10.10', None, 'https://airflow.apache.org/docs/apache-airflow/1.10.10/'),
(
'1.10.10',
'project.html',
'https://airflow.apache.org/docs/apache-airflow/1.10.10/project.html',
),
]
)
def test_should_return_link(self, version, page, expected_urk):
def test_should_return_link(self, version, page, expected_url):
with mock.patch('airflow.version.version', version):
assert expected_urk == get_docs_url(page)
assert expected_url == get_docs_url(page)

0 comments on commit c90485c

Please sign in to comment.