This repository has been archived by the owner on May 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
95 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,56 +65,123 @@ func TestGetEnv(t *testing.T) { | |
|
||
// developers test | ||
func TestCreateDeveloper(t *testing.T) { | ||
email := "[email protected]" | ||
first := "frstname" | ||
last := "lastname" | ||
user := "username" | ||
cmd := exec.Command(apigeecli, "developers", "create", "-o", org, "-n", email, "-f", first, "-s", last, "-u", user, "-t", token) | ||
email := "[email protected]" | ||
first := "frstname" | ||
last := "lastname" | ||
user := "username" | ||
|
||
cmd := exec.Command(apigeecli, "developers", "create", "-o", org, "-n", email, "-f", first, "-s", last, "-u", user, "-t", token) | ||
err := cmd.Run() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
func TestGetDeveloper(t *testing.T) { | ||
email := "[email protected]" | ||
cmd := exec.Command(apigeecli, "developers", "get", "-o", org, "-n", email, "-t", token) | ||
email := "[email protected]" | ||
|
||
cmd := exec.Command(apigeecli, "developers", "get", "-o", org, "-n", email, "-t", token) | ||
err := cmd.Run() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
func TestListDeveloper(t *testing.T) { | ||
cmd := exec.Command(apigeecli, "developers", "list", "-o", org, "-t", token) | ||
|
||
cmd := exec.Command(apigeecli, "developers", "list", "-o", org, "-t", token) | ||
err := cmd.Run() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
func TestListExpandDeveloper(t *testing.T) { | ||
expand := "true" | ||
cmd := exec.Command(apigeecli, "developers", "list", "-o", org, "-x", expand, "-t", token) | ||
expand := "true" | ||
|
||
cmd := exec.Command(apigeecli, "developers", "list", "-o", org, "-x", expand, "-t", token) | ||
err := cmd.Run() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
func TestDeleteDeveloper(t *testing.T) { | ||
email := "[email protected]" | ||
cmd := exec.Command(apigeecli, "developers", "delete", "-o", org, "-n", email, "-t", token) | ||
email := "[email protected]" | ||
|
||
cmd := exec.Command(apigeecli, "developers", "delete", "-o", org, "-n", email, "-t", token) | ||
err := cmd.Run() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
// kvm test | ||
func TestCreateKVM(t *testing.T) { | ||
name := "test" | ||
|
||
cmd := exec.Command(apigeecli, "kvms", "create", "-o", org, "-e", env, "-n", name, "-t", token) | ||
err := cmd.Run() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
func TestCreateEncKVM(t *testing.T) { | ||
name := "testEnc" | ||
enc := "true" | ||
|
||
cmd := exec.Command(apigeecli, "kvms", "create", "-o", org, "-e", env, "-n", name, "-c", enc, "-t", token) | ||
err := cmd.Run() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
func TestListKVM(t *testing.T) { | ||
|
||
cmd := exec.Command(apigeecli, "kvms", "list", "-o", org, "-e", env, "-t", token) | ||
err := cmd.Run() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
func TestDeleteKVM(t *testing.T) { | ||
name := "test" | ||
|
||
cmd := exec.Command(apigeecli, "kvms", "create", "-o", org, "-e", env, "-n", name, "-t", token) | ||
err := cmd.Run() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
func TestDeleteEnvKVM(t *testing.T) { | ||
name := "testEnc" | ||
|
||
cmd := exec.Command(apigeecli, "kvms", "create", "-o", org, "-e", env, "-n", name, "-t", token) | ||
err := cmd.Run() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
// sync tests | ||
func TestGetSync(t *testing.T) { | ||
|
||
cmd := exec.Command(apigeecli, "sync", "get", "-o", org, "-t", token) | ||
err := cmd.Run() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
func TestSetSync(t *testing.T) { | ||
ity := "[email protected]" | ||
cmd := exec.Command(apigeecli, "sync", "set", "-o", org, "-i", ity, "-t", token) | ||
err := cmd.Run() | ||
if err == nil { | ||
t.Fatal("Invalid identity test should have failed") | ||
} | ||
} |