Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
collectr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DREAL Pays de la Loire
Centre de Services de la Donnée
ADL
collectr
Commits
729af192
Commit
729af192
authored
4 months ago
by
ronan.vignard
Browse files
Options
Downloads
Plain Diff
Merge branch 'dev' into 'master'
Ajout des tests pour download_and_extract_wfs() See merge request
!57
parents
dc3f8a52
2d2ed291
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!57
Ajout des tests pour download_and_extract_wfs()
Pipeline
#535855
passed
4 months ago
Stage: build
Stage: test
Stage: pkgdown
Stage: pkgdown-move
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dev/0-dev_history.Rmd
+2
-0
2 additions, 0 deletions
dev/0-dev_history.Rmd
tests/testthat/test-download_and_extract_wfs.R
+26
-0
26 additions, 0 deletions
tests/testthat/test-download_and_extract_wfs.R
with
28 additions
and
0 deletions
dev/0-dev_history.Rmd
+
2
−
0
View file @
729af192
...
@@ -78,6 +78,7 @@ usethis::use_r("archive_table")
...
@@ -78,6 +78,7 @@ usethis::use_r("archive_table")
usethis::use_r("close_all_connections")
usethis::use_r("close_all_connections")
usethis::use_r("create_dummy")
usethis::use_r("create_dummy")
usethis::use_r("create_schema")
usethis::use_r("create_schema")
usethis::use_r("download_and_extract_wfs")
usethis::use_r("format_colnames")
usethis::use_r("format_colnames")
usethis::use_r("format_filepath")
usethis::use_r("format_filepath")
usethis::use_r("get_variable_completion_rate")
usethis::use_r("get_variable_completion_rate")
...
@@ -96,6 +97,7 @@ usethis::use_test("archive_table")
...
@@ -96,6 +97,7 @@ usethis::use_test("archive_table")
usethis::use_test("close_all_connections")
usethis::use_test("close_all_connections")
usethis::use_test("create_dummy")
usethis::use_test("create_dummy")
usethis::use_test("create_schema")
usethis::use_test("create_schema")
usethis::use_test("download_and_extract_wfs")
usethis::use_test("format_colnames")
usethis::use_test("format_colnames")
usethis::use_test("format_filepath")
usethis::use_test("format_filepath")
usethis::use_test("get_variable_completion_rate")
usethis::use_test("get_variable_completion_rate")
...
...
This diff is collapsed.
Click to expand it.
tests/testthat/test-download_and_extract_wfs.R
0 → 100644
+
26
−
0
View file @
729af192
test_that
(
"download_and_extract_wfs works"
,
{
url_wfs
<-
paste0
(
"https://services.sandre.eaufrance.fr/geo/obs?"
,
"SERVICE=WFS&"
,
"VERSION=2.0.0&"
,
"REQUEST=GetFeature&"
,
"typename=ObstEcoul_GUF&"
,
"SRSNAME=EPSG:4326&"
,
"OUTPUTFORMAT=SHAPEZIP"
)
# Appel de la fonction avec une extension valide
result
<-
download_and_extract_wfs
(
url_wfs
,
"shp"
)
# Vérification que le fichier extrait existe bien
expect_true
(
file.exists
(
result
))
# Vérification que l'extension du fichier est correcte
expect_match
(
result
,
"\\.shp$"
)
# Vérification qu'une erreur est levée
expect_error
(
object
=
download_and_extract_wfs
(
url_wfs
,
"gpkg"
),
regexp
=
"Le fichier avec l\'extension gpkg n\'a pas \u00e9t\u00e9 trouv\u00e9 dans le dossier temporaire."
)
})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment