Repository: incubator-airflow Updated Branches: refs/heads/master 813136f45 -> be886b986
[AIRFLOW-2369] Fix gcs tests The version was hardcoded and would break if you update the version of Apache Airflow Closes #3260 from Fokko/airflow-2369-fix-tests Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/be886b98 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/be886b98 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/be886b98 Branch: refs/heads/master Commit: be886b986c069b6fc955eed74d4577b65bd8d548 Parents: 813136f Author: Fokko Driesprong <fokkodriespr...@godatadriven.com> Authored: Tue Apr 24 09:24:29 2018 +0200 Committer: Bolke de Bruin <bo...@xs4all.nl> Committed: Tue Apr 24 09:24:29 2018 +0200 ---------------------------------------------------------------------- tests/contrib/operators/test_gcs_operator.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/be886b98/tests/contrib/operators/test_gcs_operator.py ---------------------------------------------------------------------- diff --git a/tests/contrib/operators/test_gcs_operator.py b/tests/contrib/operators/test_gcs_operator.py index 75d95a4..cd51933 100644 --- a/tests/contrib/operators/test_gcs_operator.py +++ b/tests/contrib/operators/test_gcs_operator.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 @@ -20,6 +20,7 @@ import unittest from airflow.contrib.operators.gcs_operator import GoogleCloudStorageCreateBucketOperator +from airflow.version import version try: from unittest import mock @@ -50,6 +51,8 @@ class GoogleCloudStorageCreateBucketTest(unittest.TestCase): operator.execute(None) mock_hook.return_value.create_bucket.assert_called_once_with( bucket_name=TEST_BUCKET, storage_class='MULTI_REGIONAL', - location='EU', labels={'airflow-version': 'v1-10-0dev0-incubating', - 'env': 'prod'}, project_id=TEST_PROJECT + location='EU', labels={ + 'airflow-version': 'v' + version.replace('.', '-').replace('+', '-'), + 'env': 'prod' + }, project_id=TEST_PROJECT )