Beispiel #1
0
def test__load_signal_test_split_true(load_signal_mock):
    train = Mock(autospec=pd.DataFrame)
    test = Mock(autospec=pd.DataFrame)

    load_signal_mock.return_value = (train, test)

    test_split = True
    returned = benchmark._load_signal('signal-name', test_split)

    assert isinstance(returned, tuple)
    assert len(returned) == 2

    expected_calls = [call('signal-name-train'), call('signal-name-test')]
    assert load_signal_mock.call_args_list == expected_calls
Beispiel #2
0
def test__load_signal_test_split_false(load_signal_mock):
    df = pd.DataFrame({
        'timestamp': list(range(10)),
        'value': list(range(10, 20))
    })
    load_signal_mock.return_value = df

    test_split = False
    returned = benchmark._load_signal('signal-name', test_split)

    assert isinstance(returned, tuple)
    assert len(returned) == 2

    train, test = returned
    pd.testing.assert_frame_equal(train, test)

    expected_calls = [
        call('signal-name'),
    ]
    assert load_signal_mock.call_args_list == expected_calls