feluelle commented on a change in pull request #6100: [AIRFLOW-5387] Fix show paused pagination bug URL: https://github.com/apache/airflow/pull/6100#discussion_r325109502
########## 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: Okay, but I mean why should `self.assertEqual(expected_result, utils.get_params(showPaused=show_paused))` raise an error? Wouldn't.. ``` self.assertEqual(expected_result, utils.get_params(showPaused=show_paused)) del os.environ['AIRFLOW__WEBSERVER__HIDE_PAUSED_DAGS_BY_DEFAULT'] ``` ..also work? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services