"""test_replay."""
# import os
#
# import pytest
#
# from tackle import main
# from tackle.utils import files
# from tackle import exceptions
#
#
# TODO: Fix when updates to replay are done
# @pytest.mark.parametrize("replay_file_name", ['bar', 'bar.json'])
# def test_get_replay_file_name(replay_file_name):
#     """Make sure that replay.get_file_name generates a valid json file path."""
#     exp_replay_file_path = os.path.join('foo', 'bar.json')
#     replay_file_path = files.get_file_name('foo', replay_file_name)
#     assert replay_file_path == exp_replay_file_path
#
#
# @pytest.mark.parametrize(
#     'invalid_kwargs',
#     (
#         {'no_input': True},
#         {'extra_context': {'stuff': 'thing'}},
#         {'no_input': True, 'extra_context': {}},
#     ),
# )
# def test_raise_on_invalid_mode(invalid_kwargs):
#     """Test `tackle` raise exception on unacceptable `replay` request."""
#     with pytest.raises(exceptions.InvalidModeException):
#         main.tackle('foo', replay=True, **invalid_kwargs)
#
#
# def test_main_does_not_invoke_dump_but_load(monkeypatch, mocker):
#     """Test `tackle` calling correct functions on `replay`."""
#     monkeypatch.chdir(os.path.abspath(os.path.dirname(__file__)))
#     mock_prompt = mocker.patch('tackle.main.prompt_for_config')
#     mock_gen_context = mocker.patch('tackle.main.generate_context')
#     mock_gen_files = mocker.patch('tackle.main.generate_files')
#     mock_replay_dump = mocker.patch('tackle.main.dump')
#     mock_replay_load = mocker.patch('tackle.main.load')
#
#     main.tackle('../legacy/fixtures/fake-repo-tmpl/', replay=True)
#
#     assert not mock_prompt.called
#     assert not mock_gen_context.called
#     assert not mock_replay_dump.called
#     assert mock_replay_load.called
#     assert mock_gen_files.called
#
#
# def test_main_does_not_invoke_load_but_dump(change_dir_main_fixtures, mocker):
#     """Test `tackle` calling correct functions on non-replay launch."""
#     mock_prompt = mocker.patch('tackle.main.get_settings')
#     mock_gen_context = mocker.patch('tackle.main.generate_context')
#     mock_gen_files = mocker.patch('tackle.main.generate_files')
#     mock_replay_dump = mocker.patch('tackle.main.dump')
#     mock_replay_load = mocker.patch('tackle.main.load')
#
#     main.tackle('fake-repo-tmpl/', replay=False)
#
#     assert mock_prompt.called
#     assert mock_gen_context.called
#     assert mock_replay_dump.called
#     assert not mock_replay_load.called
#     assert mock_gen_files.called
