Skip to content

Commit

Permalink
disable some tests requiring internet on cran
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsp-spirit committed May 25, 2021
1 parent 96048b7 commit 97c1557
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Version 0.1.15
--------------
- disable all unit tests that require downloaded data on CRAN
- add Euclidean distance util functions for surface vertices, like vertexdists.to.point and closest.vert.to.point
- add doapply.transform.mtx function (it's just matmul with some input checks that are annoying to repeat)
- add doapply.transform.mtx function (it's just matrix multiplication with some input checks that are annoying to repeat)


Version 0.1.14
Expand Down
4 changes: 4 additions & 0 deletions R/gifti_writer.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
#' @seealso The example for \code{\link{gifti_xml_write}} shows how to modify the tree.
#'
#' @examples
#' \dontrun{
#' my_data_sets = list(rep(3.1, 3L), matrix(seq(6)+0.1, nrow=2L));
#' transforms = list(NA, list('transform_matrix'=diag(4), 'data_space'='NIFTI_XFORM_UNKNOWN',
#' 'transformed_space'='NIFTI_XFORM_UNKNOWN'));
#' xmltree = gifti_xml(my_data_sets, datatype='NIFTI_TYPE_FLOAT32', transform_matrix=transforms);
#' # Verify that the tree is a valid GIFTI file:
#' gifti_xsd = "https://www.nitrc.org/frs/download.php/158/gifti.xsd";
#' xml2::xml_validate(xmltree, xml2::read_xml(gifti_xsd));
#' }
#'
#' @importFrom xml2 xml_new_root xml_set_attr xml_add_child read_xml
#' @export
Expand Down Expand Up @@ -224,6 +226,7 @@ check_data_and_settings_consistency <- function(index, data, datatype, intent, f
#' @references \url{https://www.nitrc.org/frs/download.php/2871/GIFTI_Surface_Format.pdf}
#'
#' @examples
#' \dontrun{
#' outfile = tempfile(fileext = '.gii');
#' my_data_sets = list(rep(3.1, 3L), matrix(seq(6)+0.1, nrow=2L));
#' xmltree = gifti_xml(my_data_sets, datatype='NIFTI_TYPE_FLOAT32');
Expand All @@ -233,6 +236,7 @@ check_data_and_settings_consistency <- function(index, data, datatype, intent, f
#' gifti_xsd = "https://www.nitrc.org/frs/download.php/158/gifti.xsd";
#' xml2::xml_validate(xmltree, xml2::read_xml(gifti_xsd));
#' gifti_xml_write(outfile, xmltree); # Write your custom tree to a file.
#' }
#'
#' @export
#' @importFrom xml2 write_xml
Expand Down
2 changes: 2 additions & 0 deletions man/gifti_xml.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/gifti_xml_write.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tests/testthat/test-gifti_xml_tools.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@


test_that("We can add global metadata to a GIFTI xml tree", {
testthat::skip_on_cran();
testthat::skip_if_offline(host = "www.nitrc.org");
xmltree = gifti_xml(list(rep(3.1, 3L), matrix(seq(6)+0.1, nrow=2L)));
newtree = gifti_xml_add_global_metadata(xmltree, list("User"="Me", "Weather"="Great"));
gifti_xsd = "https://www.nitrc.org/frs/download.php/158/gifti.xsd";
Expand Down

0 comments on commit 97c1557

Please sign in to comment.