Skip to content

Commit

Permalink
return to test URL
Browse files Browse the repository at this point in the history
  • Loading branch information
CIP-RIU committed Jun 6, 2019
1 parent 3365304 commit a8e39a6
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 32 deletions.
12 changes: 6 additions & 6 deletions R/fbcheck_server_sbase.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,18 @@ fbcheck_server_sbase <- function(input, output, session, values) {
print(password)

res2<- fbcheck::check_credentials(dbname= "sweetpotatobase", user=user, password=password,
#urltoken= "sgn:[email protected]/brapi/v1/token")
urltoken= "https://sweetpotatobase.org/brapi/v1/token")
urltoken= "sgn:[email protected]/brapi/v1/token")
#urltoken= "https://sweetpotatobase.org/brapi/v1/token")

if(res2$status=="error"){
shinysky::showshinyalert(session, "alert_fbappsbase_upload", paste(res2$msg), styleclass = "danger")
incProgress(6/6, detail = paste("Errors detected"))
} else {
out <- fbcheck::upload_studies(dbname= "sweetpotatobase",
# urltoken = "sgn:[email protected]/brapi/v1/token",
# urlput= "sgn:[email protected]/brapi/v1/observations",
urltoken = "https://sweetpotatobase.org/brapi/v1/token",
urlput= "https://sweetpotatobase.org/brapi/v1/observations",
urltoken = "sgn:[email protected]/brapi/v1/token",
urlput= "sgn:[email protected]/brapi/v1/observations",
#urltoken = "https://sweetpotatobase.org/brapi/v1/token",
#urlput= "https://sweetpotatobase.org/brapi/v1/observations",
user= user, password=password, dfr=fb)
print("4")
if(out$metadata$status[[6]]$code=="200"){
Expand Down
6 changes: 4 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,10 @@ fbapp2json <- function(dfr, token="lfsermmo93;3r"){
#' @export

upload_studies<- function(dbname= "sweetpotatobase",
urltoken = "https://sweetpotatobase.org/brapi/v1/token",
urlput = "https://sweetpotatobase.org/brapi/v1/observations",
#urltoken = "https://sweetpotatobase.org/brapi/v1/token",
#urlput = "https://sweetpotatobase.org/brapi/v1/observations",
urltoken = "sgn:[email protected]/brapi/v1/token",
urlput = "sgn:[email protected]/brapi/v1/observations",
user= "obenites", password=";c8U:G&z:X",dfr){


Expand Down
63 changes: 39 additions & 24 deletions tests/testthat/test_upload_sbase.R
Original file line number Diff line number Diff line change
@@ -1,32 +1,47 @@
#
# # #
# library(tidyr)
# library(dplyr)
# library(stringr)
# library(fbcheck)
# context("Organoleptic forms test")
# library(fbdesign)
# # # context("Organoleptic forms test")
# # #
# # # test_that("When F6 and F7 organolepticps NA logical", {
# # #
# # #
# dbname<- "sweetpotatobase"
# user <- "obenites"
# password <- ";c8U:G&z:X"
# fb <- readr::read_csv("tests/testthat/excel/18AMDPNaCRRI_final - Copy.csv")
# names(fb) <- gsub("[[:space:]]", "", names(fb))
# fb <- tbl_df(fb)
# # #user <- "iperezm"
# # #password <- "41954776"
#
# # out <- fbcheck::upload_studies(dbname= "sweetpotatobase",
# # # urltoken = "sgn:[email protected]/brapi/v1/token",
# # # urlput= "sgn:[email protected]/brapi/v1/observations",
# # urltoken = "https://sweetpotatobase.org/brapi/v1/token",
# # urlput= "https://sweetpotatobase.org/brapi/v1/observations",
# # user= user, password=password, dfr=fb)
#
#
# test_that("When F6 and F7 organolepticps NA logical", {
#
# urltoken <- "https://sweetpotatobase.org/brapi/v1/token"
# urlput <- "https://sweetpotatobase.org/brapi/v1/observations"
# dfr <- readr::read_csv("tests/testthat/excel/18AMDPNaCRRI_final - Copy.csv")
# names(dfr) <- gsub("[[:space:]]", "", names(dfr))
# dfr <- tbl_df(dfr)
# # urltoken <- "sgn:[email protected]/brapi/v1/token"
#
# # out <- fbcheck::upload_studies(dbname= "sweetpotatobase",
# # # urltoken = "sgn:[email protected]/brapi/v1/token",
# # # urlput= "sgn:[email protected]/brapi/v1/observations",
# # urltoken = "https://sweetpotatobase.org/brapi/v1/token",
# # urlput= "https://sweetpotatobase.org/brapi/v1/observations",
# # user= "obenites", password=password, dfr=";c8U:G&z:X")
#
# dbname<- "sweetpotatobase"
user <- "obenites"
password <- ";c8U:G&z:X"
# #user <- "iperezm"
# #password <- "41954776"
#
# urltoken <- "https://sweetpotatobase.org/brapi/v1/token"
# urlput <- "https://sweetpotatobase.org/brapi/v1/observations"
dfr <- read.csv("tests/testthat/excel/18AMDPNaCRRI_final - Copy.csv")
# #urltoken <- "sgn:[email protected]/brapi/v1/token"

out <- fbcheck::upload_studies(dbname= "sweetpotatobase",
# urltoken = "sgn:[email protected]/brapi/v1/token",
# urlput= "sgn:[email protected]/brapi/v1/observations",
urltoken = "https://sweetpotatobase.org/brapi/v1/token",
urlput= "https://sweetpotatobase.org/brapi/v1/observations",
user= "obenites", password=password, dfr=";c8U:G&z:X")


# white_list <- brapi::ba_db()
# con <- white_list[[dbname]] #get list
# con[["user"]] <- user
Expand Down Expand Up @@ -60,6 +75,6 @@ out <- fbcheck::upload_studies(dbname= "sweetpotatobase",
# #xout <- httr::content(x = res)
# #txt <- ifelse(res$status == 200, " ok!", " problem!")
# out <- httr::content(res)
#
#
# })
# # #
# # #
# # # })

0 comments on commit a8e39a6

Please sign in to comment.