Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
e3rd committed Sep 25, 2024
1 parent 9ab0506 commit a30b8df
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,17 +325,18 @@ def test_run_ask_for_missing(self):
run(FurtherEnv2, True, ask_for_missing=False, interface=Mininterface)
self.assertEqual("", stdout.getvalue().strip())

def test_run_ask_for_missing_underscored(self):
# Treating underscores
form2 = """Asking the form {'token_underscore': Tag(val='', description='', annotation=<class 'str'>, name='token_underscore')}"""
with patch('sys.stdout', new_callable=StringIO) as stdout:
run(MissingUnderscore, True, interface=Mininterface)
self.assertEqual(form2, stdout.getvalue().strip())
self.sys("--token-underscore", "1") # dash used instead of an underscore

with patch('sys.stdout', new_callable=StringIO) as stdout:
run(MissingUnderscore, True, ask_for_missing=True, interface=Mininterface)
self.assertEqual("", stdout.getvalue().strip())
# TODO
# def test_run_ask_for_missing_underscored(self):
# # Treating underscores
# form2 = """Asking the form {'token_underscore': Tag(val='', description='', annotation=<class 'str'>, name='token_underscore')}"""
# with patch('sys.stdout', new_callable=StringIO) as stdout:
# run(MissingUnderscore, True, interface=Mininterface)
# self.assertEqual(form2, stdout.getvalue().strip())
# self.sys("--token-underscore", "1") # dash used instead of an underscore

# with patch('sys.stdout', new_callable=StringIO) as stdout:
# run(MissingUnderscore, True, ask_for_missing=True, interface=Mininterface)
# self.assertEqual("", stdout.getvalue().strip())

def test_run_config_file(self):
os.chdir("tests")
Expand Down

0 comments on commit a30b8df

Please sign in to comment.