Skip to content

Commit

Permalink
#2 split WFSClient tests by version
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Jul 27, 2018
1 parent 16ebbb0 commit 5ec8ef6
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 50 deletions.
50 changes: 0 additions & 50 deletions tests/testthat/test_WFSClient.R

This file was deleted.

22 changes: 22 additions & 0 deletions tests/testthat/test_WFSClient_v1_0_0.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# test_WFSClient_v1_0_0.R
# Author: Emmanuel Blondel <emmanuel.blondel1@gmail.com>
#
# Description: Integration tests for WFS Client version 1.0.0
#=======================
require(ows4R, quietly = TRUE)
require(testthat)
context("WFS")

test_that("WFS 1.0.0",{
wfs <- WFSClient$new("http://localhost:8080/geoserver/wfs", "1.0.0", logger = "INFO")
expect_is(wfs, "WFSClient")
caps <- wfs$getCapabilities()
expect_is(caps, "WFSCapabilities")
ft <- caps$findFeatureTypeByName("topp:tasmania_water_bodies", exact = TRUE)
expect_is(ft, "WFSFeatureType")
ft.des <- ft$getDescription()
expect_is(ft.des, "list")
ft.sp <- ft$getFeatures()
expect_is(ft.sp, "sf")
expect_is(ft.sp, "data.frame")
})
22 changes: 22 additions & 0 deletions tests/testthat/test_WFSClient_v1_1_0.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# test_WFSClient_v1_1_0.R
# Author: Emmanuel Blondel <emmanuel.blondel1@gmail.com>
#
# Description: Integration tests for WFS Client version 1.1.0
#=======================
require(ows4R, quietly = TRUE)
require(testthat)
context("WFS")

test_that("WFS 1.1.0",{
wfs <- WFSClient$new("http://localhost:8080/geoserver/wfs", "1.1.0", logger = "INFO")
expect_is(wfs, "WFSClient")
caps <- wfs$getCapabilities()
expect_is(caps, "WFSCapabilities")
ft <- caps$findFeatureTypeByName("topp:tasmania_water_bodies", exact = TRUE)
expect_is(ft, "WFSFeatureType")
ft.des <- ft$getDescription()
expect_is(ft.des, "list")
ft.sp <- ft$getFeatures()
expect_is(ft.sp, "sf")
expect_is(ft.sp, "data.frame")
})
22 changes: 22 additions & 0 deletions tests/testthat/test_WFSClient_v2_0_0.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# test_WFSClient_v2_0_0.R
# Author: Emmanuel Blondel <emmanuel.blondel1@gmail.com>
#
# Description: Integration tests for WFS Client version 2.0.0
#=======================
require(ows4R, quietly = TRUE)
require(testthat)
context("WFS")

test_that("WFS 2.0.0",{
wfs <- WFSClient$new("http://localhost:8080/geoserver/wfs", "2.0.0", logger = "INFO")
expect_is(wfs, "WFSClient")
caps <- wfs$getCapabilities()
expect_is(caps, "WFSCapabilities")
ft <- caps$findFeatureTypeByName("topp:tasmania_water_bodies", exact = TRUE)
expect_is(ft, "WFSFeatureType")
ft.des <- ft$getDescription()
expect_is(ft.des, "list")
ft.sp <- ft$getFeatures()
expect_is(ft.sp, "sf")
expect_is(ft.sp, "data.frame")
})

0 comments on commit 5ec8ef6

Please sign in to comment.