Skip to content

Commit

Permalink
Updated after review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SridharJagannathan committed Jun 19, 2019
1 parent 9f3e51d commit deef1f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 1 addition & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ Suggests:
rmarkdown,
MASS,
alphashape3d,
Morpho,
RCurl,
stringr
Morpho
License: GPL-3
LazyData: yes
Collate:
Expand Down
Binary file removed tests/testthat/Rplots.pdf
Binary file not shown.
11 changes: 9 additions & 2 deletions tests/testthat/test-neuron-io.R
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,9 @@ test_that("we can write neuron/dotprops to rds file",{

})

url_ok<-function(x) identical(httr::status_code(httr::HEAD(x)), 200L)


test_that("we can write neuron to swc file",{
y=Cell07PNs[[1]]
td=tempfile()
Expand All @@ -883,10 +886,14 @@ test_that("we can write neuron to swc file",{
swc_data <- read.delim(f, stringsAsFactors = FALSE)

url_pattern <- "http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+"
swc_url <- stringr::str_extract(swc_data[[1]][1], url_pattern)

m <- gregexpr(url_pattern, swc_data[[1]][1])
swc_url <- regmatches(swc_data[[1]][1], m)[[1]]

#Check if the URL exists
expect_equal(TRUE,RCurl::url.exists(swc_url))
if(nzchar(Sys.getenv("NAT_INTERNET_TESTS"))) {
expect_true(url_ok(swc_url))}


expect_equal(write.neuron(y, dir=td, format='swc', file='rhubarb'),
file.path(td,'rhubarb.swc'))
Expand Down

0 comments on commit deef1f0

Please sign in to comment.