From 7a16f28d704b3e47405fabc8f33af71c6c475187 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Sat, 17 Oct 2020 11:31:16 -0300 Subject: [PATCH] Adapted cache tests to mcpyrate. Using `mcpyrate` we don't need to worry about cache files. --- tests/test_plot/test_misc.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/test_plot/test_misc.py b/tests/test_plot/test_misc.py index 6f5c7053..a5a241b0 100644 --- a/tests/test_plot/test_misc.py +++ b/tests/test_plot/test_misc.py @@ -481,13 +481,19 @@ def test_import_fail(): os.chmod(cache_file, stat.S_IREAD) os.chmod(cache_dir, stat.S_IREAD | stat.S_IEXEC) try: + # mcpyrate: not a problem + ret_code = 0 + # mcpy: + # ret_code = WRONG_INSTALL # Run the command - ctx.run(WRONG_INSTALL, extra=['--help-list-outputs'], no_out_dir=True, no_yaml_file=True, no_board_file=True) + ctx.run(ret_code, extra=['--help-list-outputs'], no_out_dir=True, no_yaml_file=True, no_board_file=True) finally: os.chmod(cache_dir, stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC) os.remove(cache_file) - assert ctx.search_err('Wrong installation') - assert ctx.search_err('Unable to import plug-ins') + if False: + # mcpy + assert ctx.search_err('Wrong installation') + assert ctx.search_err('Unable to import plug-ins') ctx.clean_up() @@ -500,7 +506,9 @@ def test_import_no_fail(): try: # Run the command ctx.run(extra=['--help-list-outputs'], no_out_dir=True, no_yaml_file=True, no_board_file=True) - assert not os.path.isfile(cache_file) + if False: + # mcpy + assert not os.path.isfile(cache_file) finally: if os.path.isfile(cache_file): os.remove(cache_file)