commit c6a21afa3a6d182e6f16f8860c61a4490b5685ac Author: Damian Johnson atagar@torproject.org Date: Mon Apr 18 12:52:20 2016 -0700
Fix nyx event names in tests
Oops, changed what our warning and error runlevels were but didn't update the tests. --- test/arguments.py | 12 ++++++------ test/log/condense_runlevels.py | 4 ++-- test/popups.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/test/arguments.py b/test/arguments.py index d27281c..76c6d38 100644 --- a/test/arguments.py +++ b/test/arguments.py @@ -68,7 +68,7 @@ class TestArgumentParsing(unittest.TestCase): class TestExpandEvents(unittest.TestCase): def test_examples(self): self.assertEqual(set(['INFO', 'NOTICE', 'UNKNOWN', 'TRANSPORT_LAUNCHED']), expand_events('inUt')) - self.assertEqual(set(['NOTICE', 'WARN', 'ERR', 'NYX_WARN', 'NYX_ERR']), expand_events('N4')) + self.assertEqual(set(['NOTICE', 'WARN', 'ERR', 'NYX_WARNING', 'NYX_ERROR']), expand_events('N4')) self.assertEqual(set(), expand_events('cfX'))
def test_runlevel_expansion(self): @@ -78,11 +78,11 @@ class TestExpandEvents(unittest.TestCase): self.assertEqual(set(['WARN', 'ERR']), expand_events('W')) self.assertEqual(set(['ERR']), expand_events('E'))
- self.assertEqual(set(['NYX_DEBUG', 'NYX_INFO', 'NYX_NOTICE', 'NYX_WARN', 'NYX_ERR']), expand_events('1')) - self.assertEqual(set(['NYX_INFO', 'NYX_NOTICE', 'NYX_WARN', 'NYX_ERR']), expand_events('2')) - self.assertEqual(set(['NYX_NOTICE', 'NYX_WARN', 'NYX_ERR']), expand_events('3')) - self.assertEqual(set(['NYX_WARN', 'NYX_ERR']), expand_events('4')) - self.assertEqual(set(['NYX_ERR']), expand_events('5')) + self.assertEqual(set(['NYX_DEBUG', 'NYX_INFO', 'NYX_NOTICE', 'NYX_WARNING', 'NYX_ERROR']), expand_events('1')) + self.assertEqual(set(['NYX_INFO', 'NYX_NOTICE', 'NYX_WARNING', 'NYX_ERROR']), expand_events('2')) + self.assertEqual(set(['NYX_NOTICE', 'NYX_WARNING', 'NYX_ERROR']), expand_events('3')) + self.assertEqual(set(['NYX_WARNING', 'NYX_ERROR']), expand_events('4')) + self.assertEqual(set(['NYX_ERROR']), expand_events('5'))
def test_short_circuit_options(self): # Check that the 'A' and 'X' options short circuit normal parsing, diff --git a/test/log/condense_runlevels.py b/test/log/condense_runlevels.py index f7c831c..5c06d92 100644 --- a/test/log/condense_runlevels.py +++ b/test/log/condense_runlevels.py @@ -9,5 +9,5 @@ class TestCondenseRunlevels(unittest.TestCase): self.assertEqual(['BW'], condense_runlevels('BW')) self.assertEqual(['DEBUG', 'NOTICE', 'ERR'], condense_runlevels('DEBUG', 'NOTICE', 'ERR')) self.assertEqual(['DEBUG-NOTICE', 'NYX DEBUG-INFO'], condense_runlevels('DEBUG', 'NYX_DEBUG', 'INFO', 'NYX_INFO', 'NOTICE')) - self.assertEqual(['TOR/NYX NOTICE-ERR'], condense_runlevels('NOTICE', 'WARN', 'ERR', 'NYX_NOTICE', 'NYX_WARN', 'NYX_ERR')) - self.assertEqual(['DEBUG', 'TOR/NYX NOTICE-ERR', 'BW'], condense_runlevels('DEBUG', 'NOTICE', 'WARN', 'ERR', 'NYX_NOTICE', 'NYX_WARN', 'NYX_ERR', 'BW')) + self.assertEqual(['TOR/NYX NOTICE-ERR'], condense_runlevels('NOTICE', 'WARN', 'ERR', 'NYX_NOTICE', 'NYX_WARNING', 'NYX_ERROR')) + self.assertEqual(['DEBUG', 'TOR/NYX NOTICE-ERR', 'BW'], condense_runlevels('DEBUG', 'NOTICE', 'WARN', 'ERR', 'NYX_NOTICE', 'NYX_WARNING', 'NYX_ERROR', 'BW')) diff --git a/test/popups.py b/test/popups.py index f38cb45..d782b96 100644 --- a/test/popups.py +++ b/test/popups.py @@ -313,7 +313,7 @@ class TestPopups(unittest.TestCase): def test_select_event_types_with_input(self): rendered = test.render(nyx.popups.select_event_types) self.assertEqual(EXPECTED_EVENT_SELECTOR, rendered.content) - self.assertEqual(set(['NYX_INFO', 'ERR', 'WARN', 'BW', 'NYX_ERR', 'NYX_WARN', 'NYX_NOTICE']), rendered.return_value) + self.assertEqual(set(['NYX_INFO', 'ERR', 'WARN', 'BW', 'NYX_ERROR', 'NYX_WARNING', 'NYX_NOTICE']), rendered.return_value)
@require_curses @patch('nyx.popups._top', Mock(return_value = 0))
tor-commits@lists.torproject.org