diff --git a/tests/testthat/test-get_commits-GitHub.R b/tests/testthat/test-get_commits-GitHub.R index e44bf147..5c239cb5 100644 --- a/tests/testthat/test-get_commits-GitHub.R +++ b/tests/testthat/test-get_commits-GitHub.R @@ -63,6 +63,11 @@ test_that("`get_commits_from_one_repo()` prepares formatted list", { }) test_that("`get_commits_from_repos()` pulls commits from repos", { + mockery::stub( + test_graphql_github$get_commits_from_repos, + "private$get_commits_from_one_repo", + test_mocker$use("commits_from_repo") + ) commits_from_repos <- test_graphql_github$get_commits_from_repos( org = "r-world-devs", repo = "GitStats", diff --git a/tests/testthat/test-get_files_content-GitHub.R b/tests/testthat/test-get_files_content-GitHub.R index d186365a..b670b031 100644 --- a/tests/testthat/test-get_files_content-GitHub.R +++ b/tests/testthat/test-get_files_content-GitHub.R @@ -24,7 +24,24 @@ test_that("get_repos_data pulls data on repos and branches", { ) }) +test_that("GitHub GraphQL Engine pulls file response", { + github_file_response <- test_graphql_github_priv$get_file_response( + org = "r-world-devs", + repo = "GitStats", + def_branch = "master", + file_path = "LICENSE", + files_query = test_mocker$use("gh_file_blobs_from_repo_query") + ) + expect_github_files_response(github_file_response) + test_mocker$cache(github_file_response) +}) + test_that("GitHub GraphQL Engine pulls files from organization", { + mockery::stub( + test_graphql_github$get_files_from_org, + "private$get_file_response", + test_mocker$use("github_file_response") + ) github_files_response <- test_graphql_github$get_files_from_org( org = "r-world-devs", repos = NULL, @@ -53,6 +70,11 @@ test_that("GitHub GraphQL Engine pulls .png files from organization", { }) test_that("GitHub GraphQL Engine pulls files from defined repositories", { + mockery::stub( + test_graphql_github$get_files_from_org, + "private$get_file_response", + test_mocker$use("github_file_response") + ) github_files_response <- test_graphql_github$get_files_from_org( org = "openpharma", repos = c("DataFakeR", "visR"), @@ -67,6 +89,11 @@ test_that("GitHub GraphQL Engine pulls files from defined repositories", { }) test_that("GitHub GraphQL Engine pulls two files from a group", { + mockery::stub( + test_graphql_github$get_files_from_org, + "private$get_file_response", + test_mocker$use("github_file_response") + ) github_files_response <- test_graphql_github$get_files_from_org( org = "r-world-devs", repos = NULL,