diff --git a/test/runtests.jl b/test/runtests.jl index a34010b008c704b7c78bef970d507b9ef0525146..d44271a3e47fbad614bd3283c83f893a8b4b41a8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -194,6 +194,33 @@ end end + @testset "Test upload File" begin + fname = string(uuid4()) # file name + #create temp file + touch(fname) + write(fname, "Some Content") + path = string(pwd(), "/", fname) + + ent_with_name = CaosDB.Entity.create_entity("TestFile") + set_role(ent_with_name, "FILE") + set_local_path(ent_with_name, path) + set_file_path(ent_with_name, string("/Inttests/", fname)) + + single_insert_transaction = create_transaction() + + add_insert_entity(single_insert_transaction, ent_with_name) + execute(single_insert_transaction) + results = get_results(single_insert_transaction) + + @test length(results) == 1 + @test has_errors(results[1]) == false + @test get_id(results[1]) != "" + + #cleanup + rm(fname) + + end + @testset "Test retrieve and download File by ID" begin #a file TestFile is needed on the server! ent_with_name = execute_query("FIND TestFile")