Repository: incubator-airflow Updated Branches: refs/heads/master 801fe7dbd -> 414a08e50
[AIRFLOW-2381] Fix the flaky ApiPasswordTests test This test is in conflict with different tests running in parallel By calling a simple overview page, the behaviour of checking the password is still checked, but isn't dependent on a specific dag being present in the database Closes #3269 from Fokko/AIRFLOW-2381 Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/414a08e5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/414a08e5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/414a08e5 Branch: refs/heads/master Commit: 414a08e505e2ae86f4272bfc8b0d28d66ef6ab6a Parents: 801fe7d Author: Fokko Driesprong <fokkodriespr...@godatadriven.com> Authored: Fri Apr 27 16:43:40 2018 +0200 Committer: Bolke de Bruin <bo...@xs4all.nl> Committed: Fri Apr 27 16:43:40 2018 +0200 ---------------------------------------------------------------------- .../api/experimental/test_password_endpoints.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/414a08e5/tests/www/api/experimental/test_password_endpoints.py ---------------------------------------------------------------------- diff --git a/tests/www/api/experimental/test_password_endpoints.py b/tests/www/api/experimental/test_password_endpoints.py index ecddff1..8131ff5 100644 --- a/tests/www/api/experimental/test_password_endpoints.py +++ b/tests/www/api/experimental/test_password_endpoints.py @@ -7,9 +7,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -56,24 +56,15 @@ class ApiPasswordTests(unittest.TestCase): def test_authorized(self): with self.app.test_client() as c: - url_template = '/api/experimental/dags/{}/dag_runs' - response = c.post( - url_template.format('example_bash_operator'), - data=json.dumps(dict(run_id='my_run' + datetime.now().isoformat())), - content_type="application/json", + response = c.get( + '/api/experimental/pools', headers={'Authorization': 'Basic aGVsbG86d29ybGQ='} # hello:world ) self.assertEqual(200, response.status_code) def test_unauthorized(self): with self.app.test_client() as c: - url_template = '/api/experimental/dags/{}/dag_runs' - response = c.post( - url_template.format('example_bash_operator'), - data=json.dumps(dict(run_id='my_run' + datetime.now().isoformat())), - content_type="application/json" - ) - + response = c.get('/api/experimental/pools') self.assertEqual(401, response.status_code) def tearDown(self):