chore: change test context names
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details

This commit is contained in:
knoflook 2021-10-16 13:26:03 +02:00
parent e6e2e5214f
commit dc040a0b38
Signed by: knoflook
GPG Key ID: D6A1D0E8FC4FEF1C
1 changed files with 8 additions and 7 deletions

View File

@ -31,29 +31,30 @@ func dockerContext(host, key string) TestContext {
} }
func TestCreateContext(t *testing.T) { func TestCreateContext(t *testing.T) {
err := client.CreateContext("testCreate", "wronguser", "wrongport") err := client.CreateContext("testContext0", "wronguser", "wrongport")
if err == nil { if err == nil {
t.Error("client.CreateContext(\"testCreate\", \"wronguser\", \"wrongport\") should have failed but didn't return an error") t.Error("client.CreateContext(\"testContextCreate\", \"wronguser\", \"wrongport\") should have failed but didn't return an error")
} }
err = client.CreateContext("testCreate", "", "") err = client.CreateContext("testContext0", "", "")
if err != nil { if err != nil {
t.Errorf("Couldn't create context: %s", err) t.Errorf("Couldn't create context: %s", err)
} }
} }
func TestDeleteContext(t *testing.T) { func TestDeleteContext(t *testing.T) {
ensureTestState(1, 1)
err := client.DeleteContext("default") err := client.DeleteContext("default")
if err == nil { if err == nil {
t.Errorf("client.DeleteContext(\"default\") should have failed but didn't return an error") t.Errorf("client.DeleteContext(\"default\") should have failed but didn't return an error")
} }
err = client.DeleteContext("testCreate") err = client.DeleteContext("testContext0")
if err != nil { if err != nil {
t.Errorf("client.DeleteContext(\"testCreate\") failed: %s", err) t.Errorf("client.DeleteContext(\"testContext0\") failed: %s", err)
} }
err = client.DeleteContext("testCreate") err = client.DeleteContext("testContextFail0")
if err == nil { if err == nil {
t.Errorf("client.DeleteContext(\"testCreate\") should have failed this time (attempt to delete non-existent context) but didn't return an error") t.Errorf("client.DeleteContext(\"testContextFail0\") should have failed (attempt to delete non-existent context) but didn't return an error")
} }
} }