Skip to content

Instantly share code, notes, and snippets.

@sonya
Created November 4, 2021 02:44
Show Gist options
  • Save sonya/b61ede65abf83b33e7716a55170b9288 to your computer and use it in GitHub Desktop.
Save sonya/b61ede65abf83b33e7716a55170b9288 to your computer and use it in GitHub Desktop.
http request mocking code samples
func TestGetFixedValue(t *testing.T) {
value, err := mockbyhand.GetFixedValue("http://localhost:8080")
if err != nil {
t.Error(err)
}
if value != "actualvalue" {
t.Errorf("Expected 'actualvalue', got %s", value)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment