def test_run_json_dump(mocker, mock_ensure_success, mock_user_config, template_name, context, replay_test_dir, replay_file):
 spy_get_replay_file = mocker.spy(replay, 'get_file_name')
 mock_json_dump = mocker.patch('json.dump', side_effect=json.dump)
 replay.dump(replay_test_dir, template_name, context)
 assert (not mock_user_config.called)
 mock_ensure_success.assert_called_once_with(replay_test_dir)
 spy_get_replay_file.assert_called_once_with(replay_test_dir, template_name)
 assert (mock_json_dump.call_count == 1)
 ((dumped_context, outfile_handler), kwargs) = mock_json_dump.call_args
 assert (outfile_handler.name == replay_file)
 assert (dumped_context == context)

def test_run_json_dump ( mocker , mock_ensure_success , mock_user_config , template_name , context , replay_test_dir , replay_file ) : spy_get_replay_file = mocker . spy ( replay , 'get_file_name' ) mock_json_dump = mocker . patch ( 'json.dump' , side_effect = json . dump ) replay . dump ( replay_test_dir , template_name , context ) assert ( not mock_user_config . called ) mock_ensure_success . assert_called_once_with ( replay_test_dir ) spy_get_replay_file . assert_called_once_with ( replay_test_dir , template_name ) assert ( mock_json_dump . call_count == 1 ) ( ( dumped_context , outfile_handler ) , kwargs ) = mock_json_dump . call_args assert ( outfile_handler . name == replay_file ) assert ( dumped_context == context )
test that replay .