Skip to content
Snippets Groups Projects
Commit 6c6740f4 authored by Malte Bauch's avatar Malte Bauch
Browse files

fixed initialism linting errors

parent 890f7094
Branches
Tags
2 merge requests!120Resolve "Code Quality",!90Develop
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
) )
var testAddress = "141.100.70.171:6030" var testAddress = "141.100.70.171:6030"
var testApiEndpoint = "http://141.100.70.171:8080" var testAPIEndpoint = "http://141.100.70.171:8080"
var testUsername = "admin" var testUsername = "admin"
var testPassword = "arista" var testPassword = "arista"
...@@ -20,7 +20,7 @@ func testSetupIntegration() { ...@@ -20,7 +20,7 @@ func testSetupIntegration() {
} }
api := os.Getenv("GOSDN_TEST_API_ENDPOINT") api := os.Getenv("GOSDN_TEST_API_ENDPOINT")
if api != "" { if api != "" {
testApiEndpoint = api testAPIEndpoint = api
} }
u := os.Getenv("GOSDN_TEST_USER") u := os.Getenv("GOSDN_TEST_USER")
if u != "" { if u != "" {
...@@ -53,7 +53,7 @@ func TestCliIntegration(t *testing.T) { ...@@ -53,7 +53,7 @@ func TestCliIntegration(t *testing.T) {
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
defer viper.Reset() defer viper.Reset()
if err := cli.HttpGet(testApiEndpoint, "init"); (err != nil) != tt.wantErr { if err := cli.HTTPGet(testAPIEndpoint, "init"); (err != nil) != tt.wantErr {
switch err.(type) { switch err.(type) {
case viper.ConfigFileNotFoundError: case viper.ConfigFileNotFoundError:
default: default:
...@@ -64,8 +64,8 @@ func TestCliIntegration(t *testing.T) { ...@@ -64,8 +64,8 @@ func TestCliIntegration(t *testing.T) {
cliPnd = viper.GetString("CLI_PND") cliPnd = viper.GetString("CLI_PND")
cliSbi = viper.GetString("CLI_SBI") cliSbi = viper.GetString("CLI_SBI")
if err := cli.HttpGet( if err := cli.HTTPGet(
testApiEndpoint, testAPIEndpoint,
"addDevice", "addDevice",
"address="+testAddress, "address="+testAddress,
"password="+testPassword, "password="+testPassword,
...@@ -78,8 +78,8 @@ func TestCliIntegration(t *testing.T) { ...@@ -78,8 +78,8 @@ func TestCliIntegration(t *testing.T) {
} }
did := viper.GetString("LAST_DEVICE_UUID") did := viper.GetString("LAST_DEVICE_UUID")
if err := cli.HttpGet( if err := cli.HTTPGet(
testApiEndpoint, testAPIEndpoint,
"request", "request",
"uuid="+did, "uuid="+did,
"sbi="+cliSbi, "sbi="+cliSbi,
...@@ -90,8 +90,8 @@ func TestCliIntegration(t *testing.T) { ...@@ -90,8 +90,8 @@ func TestCliIntegration(t *testing.T) {
return return
} }
if err := cli.HttpGet( if err := cli.HTTPGet(
testApiEndpoint, testAPIEndpoint,
"getDevice", "getDevice",
"address="+testAddress, "address="+testAddress,
"uuid="+did, "uuid="+did,
...@@ -103,8 +103,8 @@ func TestCliIntegration(t *testing.T) { ...@@ -103,8 +103,8 @@ func TestCliIntegration(t *testing.T) {
} }
hostname := guuid.New().String() hostname := guuid.New().String()
if err := cli.HttpGet( if err := cli.HTTPGet(
testApiEndpoint, testAPIEndpoint,
"set", "set",
"address="+testAddress, "address="+testAddress,
"uuid="+did, "uuid="+did,
......
...@@ -47,7 +47,7 @@ func TestMain(m *testing.M) { ...@@ -47,7 +47,7 @@ func TestMain(m *testing.M) {
testSetupPnd() testSetupPnd()
testSetupStore() testSetupStore()
testSetupSbi() testSetupSbi()
testSetupHttp() testSetupHTTP()
testSetupIntegration() testSetupIntegration()
os.Exit(m.Run()) os.Exit(m.Run())
} }
......
...@@ -18,7 +18,7 @@ var args string ...@@ -18,7 +18,7 @@ var args string
var argsNotFound string var argsNotFound string
var d Device var d Device
func testSetupHttp() { func testSetupHTTP() {
testSetupPnd() testSetupPnd()
sbi = &OpenConfig{id: defaultSbiID} sbi = &OpenConfig{id: defaultSbiID}
sbi.Schema() sbi.Schema()
...@@ -166,7 +166,7 @@ func Test_httpApi(t *testing.T) { ...@@ -166,7 +166,7 @@ func Test_httpApi(t *testing.T) {
t.Errorf("httpApi() got: %v, want %v", got.StatusCode, tt.want.StatusCode) t.Errorf("httpApi() got: %v, want %v", got.StatusCode, tt.want.StatusCode)
} }
if tt.name == "add-device" { if tt.name == "add-device" {
for k := range pnd.(*pndImplementation).devices.store{ for k := range pnd.(*pndImplementation).devices.store {
if k != mdid { if k != mdid {
if err := pnd.RemoveDevice(k); err != nil { if err := pnd.RemoveDevice(k); err != nil {
t.Error(err) t.Error(err)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment