ibartomeus / traitbase

This repo manages the dynamic individual trait database www.traitbase.info via traitbaseR (https://github.com/metadevpro/traitbaser)
7 stars 1 forks source link

tests and vignettes #20

Open ibartomeus opened 5 years ago

ibartomeus commented 5 years ago

[ ] Update Example_upload_data and Example_query_data.Rmd. [ ] Turn that into vignettes [ ] Unify with /tests

KevCaz commented 5 years ago

Not able to make the test pass because I don't have access to the data base yet. I'm still figuring out where do I find the common password.

KevCaz commented 5 years ago

I should be able to work on this in the near future, so I you can assign this to me.

KevCaz commented 5 years ago

Currently /tests/testthat/test-urlEncode.R tests utils::URLencode() (which is not a function of the package) while it should test urlEncode(). Actually urlEncode() is never used, I guess at some point. you figured out that utils::URLencode() was enough. Note that the logical case is not covered. I removed everything related to urlEncode(), I'll re-write it is needed.

KevCaz commented 5 years ago

urlEncode() was needed indeed, my bad I re-wrote it and it'll be back in the next PR.

KevCaz commented 5 years ago

As mentioned here https://github.com/metadevpro/traitbaser/pull/8

So far all tests pass successfully but the ones that call privateImport().

cnx <- connect('http://www.traitbase.info')
fpath <- system.file('extdata', 'sample-error.csv', package='traitbaser')
csvData <- readLines(fpath)
errors <- importDataset(cnx, csvData)

Error: lexical error: invalid char in json text.
                                       <!DOCTYPE html> <html lang="en"
                     (right here) ------^

@ibartomeus let me know if you know what to do to fix this!