Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
fix: NewExporter only takes project parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Duologic committed Jul 3, 2020
1 parent 8bd2921 commit 3359e03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import (
func TestScrape(t *testing.T) {

// TestSuccessfulConnection
exporter, _ := NewExporter("credentials.json", os.Getenv("GCP_PROJECT"))
exporter, _ := NewExporter(os.Getenv("GCP_PROJECT"))
up, _, _ := exporter.scrape()
if up == 0 {
t.Errorf("TestSuccessfulConnection: up=%v, expected=1", up)
}

// TestFailedConnection
// Set the project name to "503" since the Google Compute API will append this to the end of the BasePath
exporter, _ = NewExporter("credentials.json", "503")
exporter, _ = NewExporter("503")
exporter.service.BasePath = "https://httpbin.org/status/"
up, _, _ = exporter.scrape()
if up != 0 {
Expand Down

0 comments on commit 3359e03

Please sign in to comment.