Skip to content

Commit

Permalink
expect_equivalent is deprecated
Browse files Browse the repository at this point in the history
Use expect_equal(..., ignore_attr = TRUE) instead. Had also accidentally typed
expect_equiavalence instead of expect_equivalent before as well.
  • Loading branch information
cchristiansen committed Jul 27, 2023
1 parent 1ef0fa3 commit 2e676ea
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions anti_islanding_detection/tests/test_anti_islanding.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test_that("Test 2015 undervoltage detected", {
expected_result['antiislanding_v_excursion_2020'] <- 'undervoltage_1'

result <- detect_voltage_threshold_excursions(combined_data, PRE_EVENT_INTERVAL, WINDOW_LENGTH)
testthat::expect_equivalent(result, expected_result)
testthat::expect_equal(result, expected_result, ignore_attr = TRUE)
})
test_that("Test 2015 overvoltage 1 detected", {
combined_data <- COMBINED_DATA_TEMPLATE
Expand All @@ -39,7 +39,7 @@ test_that("Test 2015 overvoltage 1 detected", {
expected_result['antiislanding_v_excursion_2015'] <- 'overvoltage_1'

result <- detect_voltage_threshold_excursions(combined_data, PRE_EVENT_INTERVAL, WINDOW_LENGTH)
testthat::expect_equivalent(result, expected_result)
testthat::expect_equal(result, expected_result, ignore_attr = TRUE)
})
test_that("Test 2015 overvoltage 2 detected", {
combined_data <- COMBINED_DATA_TEMPLATE
Expand All @@ -49,7 +49,7 @@ test_that("Test 2015 overvoltage 2 detected", {
expected_result['antiislanding_v_excursion_2020'] <- 'overvoltage_1'

result <- detect_voltage_threshold_excursions(combined_data, PRE_EVENT_INTERVAL, WINDOW_LENGTH)
testthat::expect_equivalent(result, expected_result)
testthat::expect_equal(result, expected_result, ignore_attr = TRUE)
})

test_that("Test 2020 undervoltage 2 detected", {
Expand All @@ -60,7 +60,7 @@ test_that("Test 2020 undervoltage 2 detected", {
expected_result['antiislanding_v_excursion_2020'] <- 'undervoltage_2'

result <- detect_voltage_threshold_excursions(combined_data, PRE_EVENT_INTERVAL, WINDOW_LENGTH)
testthat::expect_equivalent(result, expected_result)
testthat::expect_equal(result, expected_result, ignore_attr = TRUE)
})
test_that("Test 2020 undervoltage 1 detected", {
combined_data <- COMBINED_DATA_TEMPLATE
Expand All @@ -70,7 +70,7 @@ test_that("Test 2020 undervoltage 1 detected", {
expected_result['antiislanding_v_excursion_2020'] <- 'undervoltage_1'

result <- detect_voltage_threshold_excursions(combined_data, PRE_EVENT_INTERVAL, WINDOW_LENGTH)
testthat::expect_equivalent(result, expected_result)
testthat::expect_equal(result, expected_result, ignore_attr = TRUE)
})
test_that("Test 2020 overvoltage 1 detected", {
combined_data <- COMBINED_DATA_TEMPLATE
Expand All @@ -80,7 +80,7 @@ test_that("Test 2020 overvoltage 1 detected", {
expected_result['antiislanding_v_excursion_2020'] <- 'overvoltage_1'

result <- detect_voltage_threshold_excursions(combined_data, PRE_EVENT_INTERVAL, WINDOW_LENGTH)
testthat::expect_equivalent(result, expected_result)
testthat::expect_equal(result, expected_result, ignore_attr = TRUE)
})
test_that("Test 2020 overvoltage 2 detected", {
combined_data <- COMBINED_DATA_TEMPLATE
Expand All @@ -90,5 +90,5 @@ test_that("Test 2020 overvoltage 2 detected", {
expected_result['antiislanding_v_excursion_2020'] <- 'overvoltage_2'

result <- detect_voltage_threshold_excursions(combined_data, PRE_EVENT_INTERVAL, WINDOW_LENGTH)
testthat::expect_equivalent(result, expected_result)
testthat::expect_equal(result, expected_result, ignore_attr = TRUE)
})
8 changes: 4 additions & 4 deletions reconnect_compliance/tests/test_create_reconnection_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ testthat::test_that("Categorising a circuit with 5s data, and just a breif ramp
ramp_rate_change_resource_limit_threshold = -0.1)


testthat::expect_equivalence(calculated_results, expected_results, tolerance = 1e-4)
testthat::expect_equal(calculated_results, expected_results, tolerance = 1e-4, ignore_attr = TRUE)
})


Expand Down Expand Up @@ -82,7 +82,7 @@ testthat::test_that("Categorising a circuit with 5s data, sustained ramp rate vi
ramp_threshold_for_non_compliance = 0.3,
ramp_rate_change_resource_limit_threshold = -0.1)

testthat::expect_equivalence(calculated_results, expected_results, tolerance = 1e-4)
testthat::expect_equal(calculated_results, expected_results, tolerance = 1e-4, ignore_attr = TRUE)
})


Expand Down Expand Up @@ -120,7 +120,7 @@ testthat::test_that("Categorising a circuit with 60s data, no ramp rate violatio
ramp_threshold_for_non_compliance = 0.3,
ramp_rate_change_resource_limit_threshold = -0.1)

testthat::expect_equivalence(calculated_results, expected_results, tolerance = 1e-4)
testthat::expect_equal(calculated_results, expected_results, tolerance = 1e-4, ignore_attr = TRUE)
})


Expand Down Expand Up @@ -159,5 +159,5 @@ testthat::test_that("Categorising a circuit with 5s data, sustained ramp rate vi
ramp_rate_change_resource_limit_threshold = -0.1)


testthat::expect_equivalence(calculated_results, expected_results, tolerance = 1e-4)
testthat::expect_equal(calculated_results, expected_results, tolerance = 1e-4, ignore_attr = TRUE)
})
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ testthat::test_that("Calculating reconnection times works",{
calculated_reconnection_times <- calculate_reconnection_times(normalised_power, event_time,
disconnect_threshold = 0.05, reconnect_threshold = 0.95)

testthat::expect_equivalence(calculated_reconnection_times, expected_reconnection_times, tolerance = 1e-4)
testthat::expect_equal(calculated_reconnection_times, expected_reconnection_times, tolerance = 1e-4, ignore_attr = TRUE)
})
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ testthat::test_that("group_disconnections_by_manufacturer",{
circuit_summary <- load_test_file(circuit_summary)
expected_output <- load_test_file(expected_output)
output <- group_disconnections_by_manufacturer(circuit_summary)
testthat::expect_equivalence(output, expected_output, tolerance = 1e-4)
testthat::expect_equal(output, expected_output, tolerance = 1e-4, ignore_attr = TRUE)
})

testthat::test_that("join_circuit_summary_and_cer_manufacturer_data",{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ testthat::test_that("group_disconnections_by_manufacturer",{
circuit_summary <- load_test_file(circuit_summary)
expected_output <- load_test_file(expected_output)
output <- group_disconnections_by_manufacturer(circuit_summary, exclude_ufls_circuits = TRUE)
testthat::expect_equivalence(output, expected_output, tolerance = 1e-4)
testthat::expect_equal(output, expected_output, tolerance = 1e-4, ignore_attr = TRUE)
})

testthat::test_that("get_number_of_ufls_disconnections",{
Expand Down

0 comments on commit 2e676ea

Please sign in to comment.