From commits-return-66726-archive-asf-public=cust-asf.ponee.io@airflow.apache.org Tue Sep 17 11:14:29 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9B36F180645 for ; Tue, 17 Sep 2019 13:14:29 +0200 (CEST) Received: (qmail 80515 invoked by uid 500); 17 Sep 2019 11:14:29 -0000 Mailing-List: contact commits-help@airflow.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.apache.org Delivered-To: mailing list commits@airflow.apache.org Received: (qmail 80506 invoked by uid 99); 17 Sep 2019 11:14:29 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Sep 2019 11:14:29 +0000 From: GitBox To: commits@airflow.apache.org Subject: [GitHub] [airflow] ashb commented on a change in pull request #6100: [AIRFLOW-5387] Fix show paused pagination bug Message-ID: <156871886882.18076.15956824208405810353.gitbox@gitbox.apache.org> Date: Tue, 17 Sep 2019 11:14:28 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit ashb commented on a change in pull request #6100: [AIRFLOW-5387] Fix show paused pagination bug URL: https://github.com/apache/airflow/pull/6100#discussion_r325110300 ########## File path: tests/www/test_utils.py ########## @@ -103,14 +105,45 @@ def test_params_search(self): self.assertEqual('search=bash_', utils.get_params(search='bash_')) - def test_params_showPaused_true(self): - """Should detect True as default for showPaused""" - self.assertEqual('', - utils.get_params(showPaused=True)) - - def test_params_showPaused_false(self): - self.assertEqual('showPaused=False', - utils.get_params(showPaused=False)) + @parameterized.expand([ + (True, False, ''), + (False, True, ''), + (True, True, 'showPaused=True'), + (False, False, 'showPaused=False'), + (None, True, ''), + (None, False, ''), + ]) + def test_params_showPaused(self, show_paused, hide_by_default, expected_result): + os.environ['AIRFLOW__WEBSERVER__HIDE_PAUSED_DAGS_BY_DEFAULT'] = str(hide_by_default) + + try: Review comment: Rather than setting the env var can you use the `conf_vars` context manager we use in other tests (check out `./tests/test_utils/config.py`) ---------------------------------------------------------------- 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 With regards, Apache Git Services