You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/12/22 12:00:22 UTC

[GitHub] [airflow] turbaszek commented on a change in pull request #13250: Fix link to Apache Airflow docs in webserver

turbaszek commented on a change in pull request #13250:
URL: https://github.com/apache/airflow/pull/13250#discussion_r547238129



##########
File path: tests/utils/test_docs.py
##########
@@ -34,14 +35,20 @@ class TestGetDocsUrl(unittest.TestCase):
             ),
             (
                 '2.0.0.dev0',
-                'migration.html',
+                'tutorial.html',
                 'http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/'
-                'apache-airflow/latest/migration.html',
+                'apache-airflow/latest/tutorial.html',
+            ),
+            ('1.10.10', None, 'https://airflow.apache.org/docs/apache-airflow/1.10.10/'),
+            (
+                '1.10.10',
+                'tutorial.html',
+                'https://airflow.apache.org/docs/apache-airflow/1.10.10/tutorial.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'),
         ]
     )
-    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):
-            self.assertEqual(expected_urk, get_docs_url(page))
+            self.assertEqual(expected_url, get_docs_url(page))
+            resp = requests.get(expected_url)
+            assert resp.status_code == 200

Review comment:
       Not sure about sending requests (in general it's not best practice) but I don't know other way to make usre what we use works - without this the test gives false positives. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org