simple common helper to parse & return path (for hmac etc) given url

This commit is contained in:
Manuel Kreutz
2017-04-09 15:45:55 -04:00
parent bd78a39bdd
commit 7b001f710b
2 changed files with 23 additions and 0 deletions

View File

@@ -270,3 +270,13 @@ func TestUnixTimestampStrToTime(t *testing.T) {
t.Error(fmt.Sprintf("Test failed. Expected '%s'. Actual '%s'.", expectedOutput, actualResult))
}
}
func TestURIPath(t *testing.T) {
testURI := "https://api.gdax.com/accounts"
expectedOutput := "/accounts"
actualOutput := GetURIPath(testURI)
if actualOutput != expectedOutput {
t.Error(fmt.Sprintf("Test failed. Expected '%s'. Actual '%s'.",
expectedOutput, actualOutput))
}
}