Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#25] - Feature/connector tests #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions test/connector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@
@test batch[1, j] == df[i, j]
end
end

@test EasyStream.hasnext(conn) == false

@test EasyStream.next(conn) === nothing

@test length(conn) == size(df, 1)

EasyStream.reset!(conn)

@test conn.state == 0


array = [1 2 3 4 5; 6 7 8 9 10]

@test_throws ArgumentError EasyStream.TablesConnector(array)

@testset "sort functionalities" begin

conn = EasyStream.TablesConnector(df, :x)
Expand Down Expand Up @@ -58,4 +63,19 @@
@test diff_elements > 0
end
end

@testset "Generator Connector" begin
function generator(n_features::Int)
return DataFrame(permutedims([rand() for _ = 1:n_features ]))
end

n_features = 5
conn = EasyStream.GeneratorConnector(generator, n_features)

data = EasyStream.next(cnn)

@test size(data, 1) == 1
@test size(data, 1) == n_features

end
end