-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adapted changes of selectors in tests and examples
- Loading branch information
1 parent
96fe77d
commit b3789b5
Showing
6 changed files
with
39 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,39 @@ | ||
sel <- "ver1" | ||
test_that("google text latest selector", { | ||
expect_no_error(output <- parse_search_results("../testdata/www.google.com_query_text_2023-03-16_08_16_05.html",engine = "google text")) | ||
expect_s3_class(output,"tbl_df") | ||
expect_no_error(output <- parse_search_results("../testdata/www.google.com_query_text_2023-03-16_08_16_05.html", engine = "google text", selectors = sel)) | ||
expect_s3_class(output, "tbl_df") | ||
}) | ||
|
||
test_that("google news latest selector", { | ||
expect_no_error(output <- parse_search_results("../testdata/www.google.com_query_news_2023-03-16_08_15_05.html",engine = "google news")) | ||
expect_s3_class(output,"tbl_df") | ||
expect_no_error(output <- parse_search_results("../testdata/www.google.com_query_news_2023-03-16_08_15_05.html", engine = "google news", selectors = sel)) | ||
expect_s3_class(output, "tbl_df") | ||
}) | ||
|
||
test_that("ddg text latest selector", { | ||
expect_no_error(output <- parse_search_results("../testdata/duckduckgo.com_query_text_2023-03-16_09_17_19.html",engine = "duckduckgo text")) | ||
expect_s3_class(output,"tbl_df") | ||
expect_no_error(output <- parse_search_results("../testdata/duckduckgo.com_query_text_2023-03-16_09_17_19.html", engine = "duckduckgo text", selectors = sel)) | ||
expect_s3_class(output, "tbl_df") | ||
}) | ||
|
||
test_that("ddg news latest selector", { | ||
expect_no_error(output <- parse_search_results("../testdata/duckduckgo.com_query_news_2023-03-16_09_15_05.html",engine = "duckduckgo text")) | ||
expect_s3_class(output,"tbl_df") | ||
expect_no_error(output <- parse_search_results("../testdata/duckduckgo.com_query_news_2023-03-16_09_15_05.html", engine = "duckduckgo text", selectors = sel)) | ||
expect_s3_class(output, "tbl_df") | ||
}) | ||
|
||
test_that("yahoo text latest selector", { | ||
expect_no_error(output <- parse_search_results("../testdata/us.yahoo.com_query_text_2023-03-20_07_57_12.html",engine = "yahoo text")) | ||
expect_s3_class(output,"tbl_df") | ||
expect_no_error(output <- parse_search_results("../testdata/us.yahoo.com_query_text_2023-03-20_07_57_12.html", engine = "yahoo text", selectors = sel)) | ||
expect_s3_class(output, "tbl_df") | ||
}) | ||
|
||
test_that("metadata reading",{ | ||
test_that("metadata reading", { | ||
expect_no_error(meta <- parse_metadata(".../testdata/www.google.com_query_text_2023-03-16_08_16_11.html")) | ||
expect_equal(meta$search_engine,"www.google.com") | ||
expect_equal(meta$type,"text") | ||
expect_equal(meta$query,"query") | ||
expect_equal(as.Date(meta$date),as.Date("2023-03-16")) | ||
expect_equal(meta$search_engine, "www.google.com") | ||
expect_equal(meta$type, "text") | ||
expect_equal(meta$query, "query") | ||
expect_equal(as.Date(meta$date), as.Date("2023-03-16")) | ||
}) | ||
|
||
test_that("folder parsing",{ | ||
expect_no_error(output <- parse_search_results("../testdata", engine = "google text")) | ||
expect_error(parse_search_results("../testdata/", engine = "google images")) | ||
expect_error(parse_search_results("void", engine = "google text")) | ||
test_that("folder parsing", { | ||
expect_no_error(output <- parse_search_results("../testdata", engine = "google text", selectors = sel)) | ||
expect_error(parse_search_results("../testdata/", engine = "google images", selectors = sel)) | ||
expect_error(parse_search_results("void", engine = "google text", selectors = sel)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters