Skip to content

Commit b6d867b

Browse files
committed
✅ test to remove some values of config
1 parent 835f92f commit b6d867b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/test_config.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,31 @@ def test_Config_add4(self, mock_input):
297297
self.assertTrue(ignore not in config.ignore)
298298

299299
config.restore()
300+
301+
@patch('builtins.input')
302+
def test_Config_del(self, mock_input):
303+
mock_input.side_effect = ['y', 'y', 'y', 'y', 'y']
304+
305+
config = Config()
306+
config.restore()
307+
308+
options = ['python', app_path,
309+
'config',
310+
'--suffix-del=py',
311+
'--comment-del=#',
312+
'--ignore-del=venv']
313+
sys.argv[1:] = options[2:]
314+
315+
args = CodeCounterArgs()
316+
self.assertTrue(args.has_config_args())
317+
config.invoke(args.config())
318+
319+
suffix = 'py'
320+
comment = '#'
321+
ignore = 'venv'
322+
323+
self.assertFalse(suffix in config.suffix)
324+
self.assertFalse(comment in config.comment)
325+
self.assertFalse(ignore in config.ignore)
326+
327+
config.restore()

0 commit comments

Comments
 (0)