We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Looks like no difference in
func TestGetDocFileWithLongLine(t *testing.T) { fpath := filepath.Join("testdata", "autogen_exclude_long_line.go") _, err := getDoc(fpath) assert.NoError(t, err) // <--- }
Precondition:
More examples:
for _, name := range expectedCertificates { _, err = pkiutil.TryLoadKeyFromDisk(certDir, name) assert.NoErrorf(t, err, "failed to load key file: %s", name) _, err = pkiutil.TryLoadCSRFromDisk(certDir, name) assert.NoError(t, err, "failed to load CSR file: %s", name) }
for _, testCase := range testCases { assert.NoError(t, scheme.Convert(testCase.obj1, testCase.obj2, nil)) assert.NoError(t, scheme.Convert(testCase.obj2, testCase.obj1, nil)) }
for _, test := range tests { err := ValidateAppArmorProfileFormat(test.profile) if test.expectValid { assert.NoError(t, err, "Profile %s should be valid", test.profile) } else { assert.Error(t, err, fmt.Sprintf("Profile %s should not be valid", test.profile)) } }
redirect, err := kubelet.GetPortForward(ctx, tc.podName, podNamespace, podUID, portforward.V4Options{}) if tc.expectError { assert.Error(t, err, description) } else { assert.NoError(t, err, description) assert.Equal(t, containertest.FakeHost, redirect.Host, description+": redirect") }
for _, testcase := range testcases { actual, err := loadDriverDefinition(testcase.filename) if testcase.err == "" { assert.NoError(t, err, testcase.name) } else { if assert.Error(t, err, testcase.name) { assert.Equal(t, testcase.err, err.Error()) } } if err == nil { assert.Equal(t, testcase.expected, actual) } }
t.Cleanup(func() { err := resp.Body.Close() assert.NoError(t, err) })
compareResponses := func(expected *NormalResponse, actual *NormalResponse, compareErr bool) func(t *testing.T) { return func(t *testing.T) { if expected == nil { require.Nil(t, actual) return } require.NotNil(t, actual) assert.Equal(t, expected.status, actual.status) if expected.body != nil { assert.Equal(t, expected.body.Bytes(), actual.body.Bytes()) } if expected.header != nil { assert.EqualValues(t, expected.header, actual.header) } assert.Equal(t, expected.errMessage, actual.errMessage) if compareErr { assert.ErrorIs(t, expected.err, actual.err) } } }
The text was updated successfully, but these errors were encountered:
testifylint
require-error
ignore-single-assertion
false
NotEmpty
Sorry, something went wrong.
Antonboom
No branches or pull requests
Looks like no difference in
Precondition:
More examples:
k8s
Grafana
The text was updated successfully, but these errors were encountered: