Skip to content

Commit

Permalink
Modify tests to check append/prepend text duplication
Browse files Browse the repository at this point in the history
Sets prepend/append text when setting up the computer/code for the non-interactive tests.
The correct duplication was already tested by an assertion, but the prepend and append texts were set to the default value of an empty string.
  • Loading branch information
ConradJohnston committed Feb 27, 2020
1 parent d7c3c7f commit 77f7e0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/cmdline/commands/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def setUp(self):
)
code.label = 'code'
code.description = 'desc'
code.set_prepend_text('text to prepend')
code.set_append_text('text to append')
code.store()
self.code = code

Expand Down Expand Up @@ -237,7 +239,7 @@ def test_code_show(self):
self.assertTrue(str(self.code.pk) in result.output)

def test_code_duplicate_interactive(self):
"""Test code duplication interacgtive."""
"""Test code duplication interactive."""
os.environ['VISUAL'] = 'sleep 1; vim -cwq'
os.environ['EDITOR'] = 'sleep 1; vim -cwq'
label = 'code_duplicate_interactive'
Expand All @@ -252,7 +254,7 @@ def test_code_duplicate_interactive(self):
self.assertEqual(self.code.get_append_text(), new_code.get_append_text())

def test_code_duplicate_non_interactive(self):
"""Test code duplication non-interacgtive."""
"""Test code duplication non-interactive."""
label = 'code_duplicate_noninteractive'
result = self.cli_runner.invoke(code_duplicate, ['--non-interactive', '--label=' + label, str(self.code.pk)])
self.assertIsNone(result.exception, result.output)
Expand Down
2 changes: 2 additions & 0 deletions tests/cmdline/commands/test_computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,8 @@ def setUpClass(cls, *args, **kwargs):
workdir='/tmp/aiida'
)
cls.comp.set_default_mpiprocs_per_machine(1)
cls.comp.set_prepend_text('text to prepend')
cls.comp.set_append_text('text to append')
cls.comp.store()

def setUp(self):
Expand Down

0 comments on commit 77f7e0f

Please sign in to comment.