github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/builtin/providers/pagerduty/config_test.go (about) 1 package pagerduty 2 3 import ( 4 "testing" 5 ) 6 7 // Test config with an empty token 8 func TestConfigEmptyToken(t *testing.T) { 9 config := Config{ 10 Token: "", 11 } 12 13 if _, err := config.Client(); err == nil { 14 t.Fatalf("expected error, but got nil") 15 } 16 } 17 18 // Test config with invalid token but with SkipCredsValidation 19 func TestConfigSkipCredsValidation(t *testing.T) { 20 config := Config{ 21 Token: "foo", 22 SkipCredsValidation: true, 23 } 24 25 if _, err := config.Client(); err != nil { 26 t.Fatalf("error: expected the client to not fail: %v", err) 27 } 28 }