def test_actual_results(params, vocab_desired, arr_desired):
    """Test that the actual results are the expected ones."""
    bop = BagOfPatterns(**params)
    arr_actual = bop.fit_transform(X)
    assert bop.vocabulary_ == vocab_desired
    if isinstance(arr_actual, np.ndarray):
        np.testing.assert_array_equal(arr_actual, arr_desired)
    else:
        np.testing.assert_array_equal(arr_actual.A, arr_desired)
Test that the actual results are the expected ones.
pyts/transformation/tests/test_bag_of_patterns.py