def test_download_and_extract_source_dir(copy, rmtree, s3_download):
    uri = _env.channel_path("code")
    _files.download_and_extract(uri, _env.code_dir)
    s3_download.assert_not_called()

    rmtree.assert_any_call(_env.code_dir)
    copy.assert_called_with(uri, _env.code_dir)
def test_download_and_and_extract_source_dir(move, rmtree, s3_download):
    uri = _env.channel_path('code')
    _files.download_and_extract(uri, 'train.sh', _env.code_dir)
    s3_download.assert_not_called()

    rmtree.assert_any_call(_env.code_dir)
    move.assert_called_with(uri, _env.code_dir)
Beispiel #3
0
def test_channel_input_dirs():
    input_data_path = _env._input_data_dir
    assert _env.channel_path('evaluation') == os.path.join(
        input_data_path, 'evaluation')
    assert _env.channel_path('training') == os.path.join(
        input_data_path, 'training')
Beispiel #4
0
def test_download_and_and_extract_file(copy, s3_download):
    uri = _env.channel_path('code')
    _files.download_and_extract(uri, _env.code_dir)

    s3_download.assert_not_called()
    copy.assert_called_with(uri, _env.code_dir)
Beispiel #5
0
def test_channel_input_dirs():
    input_data_path = _env._input_data_dir
    assert _env.channel_path("evaluation") == os.path.join(
        input_data_path, "evaluation")
    assert _env.channel_path("training") == os.path.join(
        input_data_path, "training")