Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: usability in unit tests #5

Closed
fsamin opened this issue Feb 18, 2017 · 0 comments
Closed

feat: usability in unit tests #5

fsamin opened this issue Feb 18, 2017 · 0 comments
Labels

Comments

@fsamin
Copy link
Member

fsamin commented Feb 18, 2017

Would like to use venom steps in a golang unit tests as following

func TestSomething(t *testing.T) {
    steps := []venom.Step{
        {
             Type: "http",
             Method: "POST",
             URL: "https://eu.api.ovh.com/1.0/auth/logout",
             Assertions: []venom.Assertion{
                 {"result.statuscode", venom.Asserts.ShouldEqual, 401},
             },
        },
    }
    venom.Run(t, steps)
}

or

func TestSomething(t *testing.T) {
    steps := []venom.Step{
        {
             Type: "http",
             Method: "POST",
             URL: "https://eu.api.ovh.com/1.0/auth/logout", //No default assertions at all
        },
    }
    v := venom.Run(t, steps)
    assert.NoError(t, v.Err())
    assert.NoEqual(t, v.Result["statuscode"], 401)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants