Skip to content

Commit

Permalink
Added chat gipty tests
Browse files Browse the repository at this point in the history
  • Loading branch information
azimov committed May 2, 2024
1 parent 0cc4156 commit 090b1e0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/testthat/test-DataModelFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,29 @@ test_that("Bad model format", {
checkmate::expect_date(data$dateField)
})


# Create test data
pkValuesInDb <- data.frame(
id = c(1, 2, 3),
name = c("Alice", "Bob", "Charlie"),
stringsAsFactors = FALSE
)

chunk <- data.frame(
id = c(1, 2, 3),
name = c("Alice", "Bob", "Charlie"),
stringsAsFactors = FALSE
)

# Tests for when types match
test_that("formatChunk converts data types correctly", {
expect_identical(
formatChunk(pkValuesInDb, chunk),
chunk,
info = "Data frames should remain unchanged when types match."
)
})

# Tests for when types need conversion
chunk_numeric <- data.frame(
id = c(1, 2, 3),
Expand Down

0 comments on commit 090b1e0

Please sign in to comment.