Skip to content

Commit

Permalink
Drop parse_command_line_debug_opts()
Browse files Browse the repository at this point in the history
  • Loading branch information
zas committed Apr 8, 2024
1 parent 3e9a666 commit e33ed2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
6 changes: 0 additions & 6 deletions picard/debug_opts.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,3 @@ class DebugOpt(DebugOptSuper):

_debug_opts = set()
DebugOpt.set_registry(_debug_opts)


def parse_command_line_debug_opts(string):
"""Parse command line argument, a string with comma-separated values,
and enable corresponding debug options"""
DebugOpt.from_string(string)
17 changes: 7 additions & 10 deletions test/test_debug_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@

from test.picardtestcase import PicardTestCase

from picard.debug_opts import (
DebugOpt,
parse_command_line_debug_opts,
)
from picard.debug_opts import DebugOpt


class DebugOptTest(PicardTestCase):
Expand Down Expand Up @@ -54,17 +51,17 @@ def test_opt_names(self):
self.assertEquals(DebugOpt.opt_names(), 'ws_replies')

@patch('picard.debug_opts._debug_opts', set())
def test_parse_command_line_debug_opts_simple(self):
parse_command_line_debug_opts('ws_replies')
def test_from_string_simple(self):
DebugOpt.from_string('ws_replies')
self.assertTrue(DebugOpt.WS_REPLIES.enabled)

@patch('picard.debug_opts._debug_opts', set())
def test_parse_command_line_debug_opts_complex(self):
parse_command_line_debug_opts('something, WS_replieS,x')
def test_from_string_complex(self):
DebugOpt.from_string('something, WS_replieS,x')
self.assertTrue(DebugOpt.WS_REPLIES.enabled)

@patch('picard.debug_opts._debug_opts', {DebugOpt.WS_REPLIES})
def test_parse_command_line_debug_opts_remove(self):
def test_from_string_remove(self):
self.assertTrue(DebugOpt.WS_REPLIES.enabled)
parse_command_line_debug_opts('something')
DebugOpt.from_string('something')
self.assertFalse(DebugOpt.WS_REPLIES.enabled)

0 comments on commit e33ed2a

Please sign in to comment.