@@ -561,37 +561,32 @@ def test_report(self, run_cli_command):
561
561
assert len (result .output_lines ) == 1 , result .output_lines
562
562
assert result .output_lines [0 ] == 'No log messages recorded for this entry'
563
563
564
- # def test_process_dump(self, run_cli_command, tmp_path, generate_workchain_multiply_add):
565
- # """Test verdi process dump"""
566
564
567
- # # Only test CLI interface here, the actual functionalities of the Python API are tested in `test_processes.py`
568
- # test_path = tmp_path / 'cli-dump'
569
- # node = generate_workchain_multiply_add()
565
+ def test_dump (self , run_cli_command , tmp_path , generate_calculation_node_add ):
566
+ """Test verdi process dump"""
567
+ # Only test CLI interface here, the actual functionalities of the Python API are tested elsewhere
568
+ test_path = tmp_path / 'cli-dump'
569
+ node = generate_calculation_node_add ()
570
570
571
- # # Giving a single identifier should print a non empty string message
572
- # options = [str(node.pk), '-p', str(test_path)]
573
- # result = run_cli_command(cmd_process.process_dump, options)
574
- # assert result.exception is None, result.output
575
- # assert 'Success:' in result.output
576
-
577
- # # Trying to run the dumping again in the same path but with overwrite=False should raise exception
578
- # options = [str(node.pk), '-p', str(test_path), '--no-incremental']
579
- # result = run_cli_command(cmd_process.process_dump, options, raises=True)
580
- # assert result.exit_code is ExitCode.CRITICAL
581
-
582
- # # Works fine when using overwrite=True
583
- # options = [str(node.pk), '-p', str(test_path), '-o', '--no-incremental']
584
- # result = run_cli_command(cmd_process.process_dump, options)
585
- # assert result.exception is None, result.output
586
- # assert 'Success:' in result.output
587
-
588
- # # Set overwrite=True but provide bad directory, i.e. missing metadata file
589
- # (test_path / 'aiida_node_metadata.yaml').unlink()
571
+ # Test dry run
572
+ options = [str (node .pk ), '--path' , str (test_path / 'dry' ), '--dry-run' ]
573
+ result = run_cli_command (cmd_process .process_dump , options )
574
+ assert result .exception is None , result .output
575
+ assert 'Dry run completed' in result .output
576
+ assert not test_path .exists ()
590
577
591
- # options = [str(node.pk), '-p', str(test_path), '-o']
592
- # result = run_cli_command(cmd_process.process_dump, options, raises=True)
593
- # assert result.exit_code is ExitCode.CRITICAL
578
+ # Basic dump test
579
+ options = [str (node .pk ), '--path' , str (test_path )]
580
+ result = run_cli_command (cmd_process .process_dump , options )
581
+ assert result .exception is None , result .output
582
+ assert 'Success:' in result .output
583
+ assert test_path .exists ()
594
584
585
+ # Test overwrite
586
+ options = [str (node .pk ), '--path' , str (test_path ), '--overwrite' ]
587
+ result = run_cli_command (cmd_process .process_dump , options )
588
+ assert result .exception is None , result .output
589
+ assert 'Success:' in result .output
595
590
596
591
@pytest .mark .usefixtures ('aiida_profile_clean' )
597
592
@pytest .mark .parametrize ('numprocesses, percentage' , ((0 , 100 ), (1 , 90 )))
0 commit comments