Fix vehicle tests
This commit is contained in:
parent
810a60a4c3
commit
9120014728
2 changed files with 6 additions and 2 deletions
|
|
@ -18,8 +18,8 @@ func TestVehicles(t *testing.T) {
|
|||
"Missing required parameter", // Renault
|
||||
"error connecting: Network Error",
|
||||
"unexpected status: 401",
|
||||
"could not obtain token", // Porsche
|
||||
"login failed: 400 Bad Request", // Tesla
|
||||
"could not obtain token", // Porsche
|
||||
"missing credentials", // Tesla
|
||||
}
|
||||
|
||||
for _, tmpl := range test.ConfigTemplates("vehicle") {
|
||||
|
|
|
|||
|
|
@ -50,6 +50,10 @@ func NewTeslaFromConfig(other map[string]interface{}) (api.Vehicle, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if cc.User == "" && cc.Tokens.Access == "" {
|
||||
return nil, errors.New("missing credentials")
|
||||
}
|
||||
|
||||
v := &Tesla{
|
||||
embed: &embed{cc.Title, cc.Capacity},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue