Skip to content

Commit

Permalink
Simplify tests by defining data at top
Browse files Browse the repository at this point in the history
  • Loading branch information
Glenn Moynihan committed Jun 30, 2021
1 parent af4b1b4 commit adb45c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/types/cube.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
@testset "apply_append" begin

@testset "OneToOne" begin

T = FakeOneToOneTransform()

@test FeatureTransforms.apply_append(x, T; append_dim=1) == vcat(x, ones(2, 3, 4))
Expand All @@ -72,6 +73,7 @@
end

@testset "OneToMany" begin

T = FakeOneToManyTransform()

@test_throws DimensionMismatch FeatureTransforms.apply_append(x, T; append_dim=1)
Expand All @@ -89,6 +91,7 @@
end

@testset "ManyToOne" begin

T = FakeManyToOneTransform()

@test isequal(
Expand All @@ -108,6 +111,7 @@
end

@testset "ManyToMany" begin

T = FakeManyToManyTransform()

@test_throws DimensionMismatch FeatureTransforms.apply_append(x, T; append_dim=1)
Expand Down
4 changes: 4 additions & 0 deletions test/types/tables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@testset "apply" begin

@testset "OneToOne" begin

T = FakeOneToOneTransform()

@test isequal(
Expand All @@ -25,6 +26,7 @@
end

@testset "OneToMany" begin

T = FakeOneToManyTransform()

@test isequal(
Expand All @@ -42,6 +44,7 @@
end

@testset "ManyToOne" begin

T = FakeManyToOneTransform()

@test isequal(
Expand Down Expand Up @@ -99,6 +102,7 @@
_table = deepcopy(table)
@test_broken FeatureTransforms.apply!(_table, T; cols=:b, dims=[1, 2])
@test_broken _table == TableType((a=[1, 2, 3], b=[1, 1, 6]))

end

@testset "apply_append" begin
Expand Down

0 comments on commit adb45c6

Please sign in to comment.