@@ -2,6 +2,8 @@ using WebDataset
22using Test
33
44@testset " WebDataset.jl" begin
5+ sampletar = " sample.tar"
6+
57 # generic_open
68 @test read (generic_open (" pipe:echo hello" ), String) == " hello\n "
79 @test read (generic_open (" /dev/null" ), String) == " "
@@ -13,27 +15,27 @@ using Test
1315 @test braceexpand (" a{1..2}{1..2}bc" ) == [" a11bc" , " a12bc" , " a21bc" , " a22bc" ]
1416
1517 # tar file iterator
16- @test tariterator (open (" test/sample.tar " )) |> collect |> length == 180
18+ @test tariterator (open (sampletar )) |> collect |> length == 180
1719
1820 # sample iteration
19- @test sampleiterator (open (" test/sample.tar " )) |> collect |> length == 90
20- @test sampleiterator (open (" test/sample.tar " )) |> sampleshuffle |> collect |> length == 90
21+ @test sampleiterator (open (sampletar )) |> collect |> length == 90
22+ @test sampleiterator (open (sampletar )) |> sampleshuffle |> collect |> length == 90
2123
2224 # transforms
23- l = sampleiterator (open (" test/sample.tar " )) |> it-> sampletransforms (it, default_decoders) |> collect
25+ l = sampleiterator (open (sampletar )) |> it-> sampletransforms (it, default_decoders) |> collect
2426 @test length (l) == 90
2527 first = l[1 ][" .img" ]
2628 @test size (first) == (28 , 28 )
2729
2830 # batching
29- l = sampleiterator (open (" test/sample.tar " )) |> it-> samplebatching (it, 10 ) |> collect
31+ l = sampleiterator (open (sampletar )) |> it-> samplebatching (it, 10 ) |> collect
3032 @test length (l) == 9
3133 first = l[1 ][" .png" ]
3234 @test length (first) == 10
3335
3436 # data loader
3537 ds = DatasetDescriptor (
36- sources= [" test/sample.tar " , " test/sample.tar " ],
38+ sources= [sampletar, sampletar ],
3739 shuffle= 10 ,
3840 batchsize= 10 ,
3941 decoding= default_decoders,
0 commit comments