From e46a60f8367b0b578e423029777270da9bbba5c7 Mon Sep 17 00:00:00 2001 From: Yannic Staudt Date: Wed, 28 Feb 2024 19:14:01 +0100 Subject: [PATCH] :wrench: using the auth helpers in the remaining tests --- test/gh-refs.cpp | 6 ++---- test/gh-repos.cpp | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/test/gh-refs.cpp b/test/gh-refs.cpp index 31725637..61e1f553 100644 --- a/test/gh-refs.cpp +++ b/test/gh-refs.cpp @@ -2,6 +2,7 @@ #include #include
+#include "utils.hpp"
 
 int main(int argc, char** argv) {
 
@@ -17,10 +18,7 @@ int main(int argc, char** argv) {
     std::cout << "Successfully retrieved " << refs.size() << " refs from github.com/grpc/grpc - which is a PASS" << std::endl;
   });
 
-  gh::auth auth{ 
-    std::getenv("GH_USER"),
-    std::getenv("GH_PASS")
-  };
+  auto auth = test_utils::get_auth();
 
   gh::get_refs("boostorg", "fusion", gh::filter_refs::TAGS, [](gh::git_data::refs&& tags) {
     std::cout << pre::json::to_json(tags).dump(2) << std::endl;
diff --git a/test/gh-repos.cpp b/test/gh-repos.cpp
index 62469ea3..b9da31e4 100644
--- a/test/gh-repos.cpp
+++ b/test/gh-repos.cpp
@@ -14,10 +14,7 @@ int main(int argc, char** argv) {
     std::cout << pre::json::to_json(r).dump(2) << std::endl;
   });
 
-  gh::auth auth{ 
-    std::getenv("GH_USER"),
-    std::getenv("GH_PASS")
-  };
+  auto auth = test_utils::get_auth();
 
   gh::repos_get("cpp-pre", "json", [](gh::repos::repository_t&& r) {
     std::cout << pre::json::to_json(r).dump(2) << std::endl;