Error: The API key has not been well set in the .Renviron file. Run fw_setapikey() and follow the instruction carefully.

fetchdata2 <- fw_fetchdata(data = c("Abramis brama",'Salmo trutta fario'),
ecoparams = 'migration', cachefolder = 'cache')
fetchdata <- fw_fetchdata(data = c("Abramis brama"),
fetchdata1 <- fw_fetchdata(data = c("Abramis brama"),

test_that(desc = "tchecks",
code = {
expect_equal(length(tcheck(c("mi", "fi", 'pp','pb','di','mp'))), 6)
expect_equal(length(tcheck(c("mi", "fi", 'pp','pb','di','mp'), TRUE)), 6)
expect_error(tcheck('mm'))#wrong taxa
#test for migration ecoparam retruns warning
expect_warning(fw_searchdata(organismgroup = 'fi', taxa_searched = 'Abramis brama', ecoparams = 'migte'))
expect_warning(fw_searchdata(organismgroup = 'pb', taxa_searched = 'Achnantheffs danica',
ecoparams = 'life form', taxalevel = 'species', seed = 1233, warn = TRUE))
})

test_that("fw_setapikey tries to open .Renviron", {
expect_error(fw_keyload("api_key1")) #wrong api key variable name