Skip to content

Commit

Permalink
Added unit tests for issue #118
Browse files Browse the repository at this point in the history
  • Loading branch information
tomschenkjr committed Nov 17, 2016
1 parent 7714a0e commit 9fbf207
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Description: Provides easier interaction with
format and manages throttling by 'Socrata'.
Users can upload data to Socrata portals directly
from R.
Version: 1.7.1-24
Date: 2016-11-04
Version: 1.7.2-1
Date: 2016-11-16
Author: Hugh Devlin, Ph. D., Tom Schenk, Jr., and John Malc
Maintainer: "Tom Schenk Jr." <[email protected]>
Depends:
Expand Down
10 changes: 10 additions & 0 deletions tests/testthat/test-all.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ test_that("read Socrata CSV as default", {
label="testing column CSV classes with defaults")
})

test_that("read Socrata CSV from New Backend (NBE) endpoint", {
df <- read.socrata("https://odn.data.socrata.com/resource/pvug-y23y.csv")
expect_equal("data.frame", class(df), label="class", info="https://github.com/Chicago/RSocrata/issues/118")
expect_equal(68087, nrow(df), label="rows", info="https://github.com/Chicago/RSocrata/issues/118")
expect_equal(4, ncol(df), label="columns", info="https://github.com/Chicago/RSocrata/issues/118")
expect_equal(c("character", "character", "character", "numeric"),
unname(sapply(sapply(df, class),`[`, 1)),
label="testing column CSV classes with defaults")
})

test_that("read Socrata CSV as character", {
df <- read.socrata('https://soda.demo.socrata.com/resource/4334-bgaj.csv',
stringsAsFactors = FALSE)
Expand Down

0 comments on commit 9fbf207

Please sign in to comment.