You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by xd...@apache.org on 2020/11/08 10:39:16 UTC

[airflow] branch master updated: Remove redundant asserts in tests/www/test_views.py (#12176)

This is an automated email from the ASF dual-hosted git repository.

xddeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new 7dfb398  Remove redundant asserts in tests/www/test_views.py (#12176)
7dfb398 is described below

commit 7dfb3980cecfafdb7d6b79d17455b08971cec7d4
Author: Xiaodong DENG <xd...@gmail.com>
AuthorDate: Sun Nov 8 11:38:35 2020 +0100

    Remove redundant asserts in tests/www/test_views.py (#12176)
    
    Methods 'check_content_not_in_response'/'check_content_in_response' already
    take care of status code check (by default asserts against 200)
    
    So no need to check status code explicitly if either of these two methods are
    used to check the response.
---
 tests/www/test_views.py | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tests/www/test_views.py b/tests/www/test_views.py
index 2fa6045..9abe0d3 100644
--- a/tests/www/test_views.py
+++ b/tests/www/test_views.py
@@ -810,7 +810,6 @@ class TestAirflowBaseViews(TestBase):
             data={'dag_ids': ['example_subdag_operator', 'example_bash_operator']},
             follow_redirects=True,
         )
-        self.assertEqual(resp.status_code, 200)
         stats = json.loads(resp.data.decode('utf-8'))
         self.assertIn('example_bash_operator', stats)
         self.assertIn('example_subdag_operator', stats)
@@ -1977,7 +1976,6 @@ class TestDagACLView(TestBase):
             data={'dag_ids': ['example_subdag_operator', 'example_bash_operator']},
             follow_redirects=True,
         )
-        self.assertEqual(resp.status_code, 200)
         stats = json.loads(resp.data.decode('utf-8'))
         self.assertIn('example_bash_operator', stats)
         self.assertIn('example_subdag_operator', stats)
@@ -2049,7 +2047,6 @@ class TestDagACLView(TestBase):
             data={'dag_ids': ['example_subdag_operator', 'example_bash_operator']},
             follow_redirects=True,
         )
-        self.assertEqual(resp.status_code, 200)
         stats = json.loads(resp.data.decode('utf-8'))
         self.assertIn('example_bash_operator', stats)
         self.assertIn('example_subdag_operator', stats)
@@ -2353,7 +2350,6 @@ class TestDagACLView(TestBase):
             data={'dag_ids': ['example_subdag_operator', 'example_bash_operator']},
             follow_redirects=True,
         )
-        self.assertEqual(resp.status_code, 200)
         blocked_dags = {blocked['dag_id'] for blocked in json.loads(resp.data.decode('utf-8'))}
         self.assertIn('example_bash_operator', blocked_dags)
         self.assertIn('example_subdag_operator', blocked_dags)