From 743483a3e09e0d3725d7cee5f197bdaf6112e098 Mon Sep 17 00:00:00 2001 From: mpadge Date: Tue, 20 Feb 2024 11:37:55 +0100 Subject: [PATCH] fix tests for #26 --- DESCRIPTION | 2 +- codemeta.json | 2 +- tests/testthat/test-gtfs.R | 8 ++++++-- tests/testthat/test-prepare-data.R | 8 +++++--- tests/testthat/test-weight-networks.R | 3 +-- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 8643be77..6eff64ad 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: m4ra Title: Many-to-Many Multi-Modal Routing Aggregator -Version: 0.1.1.032 +Version: 0.1.1.033 Authors@R: person(given = "Mark", family = "Padgham", diff --git a/codemeta.json b/codemeta.json index 5963545f..6dde1bf9 100644 --- a/codemeta.json +++ b/codemeta.json @@ -7,7 +7,7 @@ "codeRepository": "https://github.com/UrbanAnalyst/m4ra", "issueTracker": "https://github.com/UrbanAnalyst/m4ra/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.1.1.032", + "version": "0.1.1.033", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", diff --git a/tests/testthat/test-gtfs.R b/tests/testthat/test-gtfs.R index 9fa37ca9..e72965eb 100644 --- a/tests/testthat/test-gtfs.R +++ b/tests/testthat/test-gtfs.R @@ -59,7 +59,9 @@ fake_network_data <- function (gtfs, npts = 1e3) { test_that ("gtfs travel times", { z <- gtfsrouter::berlin_gtfs_to_zip () - gtfs <- gtfsrouter::extract_gtfs (z) + suppressWarnings ( + gtfs <- gtfsrouter::extract_gtfs (z) + ) gtfs <- gtfsrouter::gtfs_timetable (gtfs, day = "Monday") Sys.setenv ("M4RA_NUM_CORES" = 1L) @@ -84,7 +86,9 @@ test_that ("gtfs travel times", { test_that ("gtfs to graph fns", { z <- gtfsrouter::berlin_gtfs_to_zip () - gtfs <- gtfsrouter::extract_gtfs (z) + suppressWarnings ( + gtfs <- gtfsrouter::extract_gtfs (z) + ) gtfs <- gtfsrouter::gtfs_timetable (gtfs, day = "Monday") npts <- 1e3L diff --git a/tests/testthat/test-prepare-data.R b/tests/testthat/test-prepare-data.R index fa662268..2717f553 100644 --- a/tests/testthat/test-prepare-data.R +++ b/tests/testthat/test-prepare-data.R @@ -7,7 +7,9 @@ test_that ("prepare data", { Sys.setenv ("M4RA_NUM_CORES" = 1L) z <- gtfsrouter::berlin_gtfs_to_zip () - gtfs <- gtfsrouter::extract_gtfs (z) + suppressWarnings ( + gtfs <- gtfsrouter::extract_gtfs (z) + ) gtfs_path <- fs::path (fs::path_temp (), "berlin-gtfs.Rds") saveRDS (gtfs, gtfs_path) @@ -41,9 +43,9 @@ test_that ("prepare data", { expect_type (flist, "character") expect_true (all (fs::file_exists (flist))) - expect_length (flist, 29L) + expect_length (flist, 23L) # 3 weighted networks: - expect_length (grep ("foot|bicycle|motorcar", flist), 25L) + expect_length (grep ("foot|bicycle|motorcar", flist), 19L) # 1 GTFS source: expect_length (grep ("berlin\\-gtfs\\.Rds$", flist), 1L) # plus three GTFS travel time matrices, and one GTFS-to-final network time diff --git a/tests/testthat/test-weight-networks.R b/tests/testthat/test-weight-networks.R index d53cbf25..e52e064a 100644 --- a/tests/testthat/test-weight-networks.R +++ b/tests/testthat/test-weight-networks.R @@ -1,4 +1,3 @@ - test_all <- (identical (Sys.getenv ("MPADGE_LOCAL"), "true") | identical (Sys.getenv ("GITHUB_WORKFLOW"), "test-coverage")) @@ -26,6 +25,6 @@ test_that ("weight networks", { ) expect_type (f, "character") - expect_length (f, 24L) + expect_length (f, 18L) expect_true (all (fs::file_exists (f))) })