You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2020/06/26 22:01:26 UTC
[airflow] branch v1-10-test updated: fixup! Avoid color info in
response of /dag_stats & /task_stats (#8742)
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v1-10-test by this push:
new c1f7451 fixup! Avoid color info in response of /dag_stats & /task_stats (#8742)
c1f7451 is described below
commit c1f7451212922c3bc973aae5b3562f460416ac8b
Author: Kaxil Naik <ka...@gmail.com>
AuthorDate: Fri Jun 26 23:00:19 2020 +0100
fixup! Avoid color info in response of /dag_stats & /task_stats (#8742)
---
tests/www_rbac/test_views.py | 27 ++++++++++-----------------
1 file changed, 10 insertions(+), 17 deletions(-)
diff --git a/tests/www_rbac/test_views.py b/tests/www_rbac/test_views.py
index 894e92f..2a18c6a 100644
--- a/tests/www_rbac/test_views.py
+++ b/tests/www_rbac/test_views.py
@@ -485,23 +485,16 @@ class TestAirflowBaseViews(TestBase):
self.assertIsNone(None, resp_json['scheduler']['latest_scheduler_heartbeat'])
def test_home(self):
- with self.capture_templates() as templates:
- resp = self.client.get('home', follow_redirects=True)
- self.check_content_in_response('DAGs', resp)
- val_state_color_mapping = 'const STATE_COLOR = {"failed": "red", ' \
- '"null": "lightblue", "queued": "gray", ' \
- '"removed": "lightgrey", "running": "lime", ' \
- '"scheduled": "tan", "shutdown": "blue", ' \
- '"skipped": "pink", "success": "green", ' \
- '"up_for_reschedule": "turquoise", ' \
- '"up_for_retry": "gold", "upstream_failed": "orange"};'
- self.check_content_in_response(val_state_color_mapping, resp)
-
- self.assertEqual(len(templates), 1)
- self.assertEqual(templates[0].name, 'airflow/dags.html')
- state_color_mapping = State.state_color.copy()
- state_color_mapping["null"] = state_color_mapping.pop(None)
- self.assertEqual(templates[0].local_context['state_color'], state_color_mapping)
+ resp = self.client.get('home', follow_redirects=True)
+ self.check_content_in_response('DAGs', resp)
+ val_state_color_mapping = 'const STATE_COLOR = {"failed": "red", ' \
+ '"null": "lightblue", "queued": "gray", ' \
+ '"removed": "lightgrey", "running": "lime", ' \
+ '"scheduled": "tan", "shutdown": "blue", ' \
+ '"skipped": "pink", "success": "green", ' \
+ '"up_for_reschedule": "turquoise", ' \
+ '"up_for_retry": "gold", "upstream_failed": "orange"};'
+ self.check_content_in_response(val_state_color_mapping, resp)
def test_home_filter_tags(self):
from airflow.www_rbac.views import FILTER_TAGS_COOKIE