Delete unused code, use assert package for tests

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-08-04 00:42:28 -04:00
parent 8259f16f19
commit 324c398145
4 changed files with 35 additions and 154 deletions
+3 -6
View File
@@ -81,16 +81,13 @@ func testClientServices(t *testing.T, c *Client) {
cv := reflect.Indirect(cp)
for _, s := range services {
if cv.FieldByName(s).IsNil() {
t.Fatalf("c.%s shouldn't be nil", s)
}
assert.Falsef(t, cv.FieldByName(s).IsNil(), "c.%s should not be nil", s)
}
}
func testClientDefaultUserAgent(t *testing.T, c *Client) {
if expect, actual := fmt.Sprintf("golang:%s:v%s (by /u/)", libraryName, libraryVersion), c.userAgent; expect != actual {
t.Fatalf("got unexpected value\nexpect: %+v\nactual: %+v", Stringify(expect), Stringify(actual))
}
expectedUserAgent := fmt.Sprintf("golang:%s:v%s (by /u/)", libraryName, libraryVersion)
assert.Equal(t, expectedUserAgent, c.userAgent)
}
func testClientDefaults(t *testing.T, c *Client) {