Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
update tests and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Aug 4, 2019
1 parent d559706 commit b297a3c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 86 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,19 @@ The following parameters are required. See Common Reference for a list of additi

A sample file format can be found [here](https://github.com/srinandan/apigeecli/blob/master/test/products_config.json)

### <a name ="expproducts"/> export

Export API products to a file

```
apigeecli prods export -o org -c connections
```
Required parameters
The following parameters are required. See Common Reference for a list of additional parameters.

`--org -o` (required) Apigee organization name
`--conn -c` (optional) Number of connections to establish; default is 4

---

## <a name="sf"/> sharedflows
Expand Down
9 changes: 9 additions & 0 deletions cmd/shared/shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,12 @@ func TestDownloadResource(t *testing.T) {
t.Fatal(err)
}
}

func TestWriteJSONArrayToFile(t *testing.T) {
Init()
var entityPayloadList = [][]byte{{'g', 'o'}, {'l', 'a', 'n', 'g'}}
err := WriteJSONArrayToFile("test.json", entityPayloadList)
if err != nil {
t.Fatal(err)
}
}
10 changes: 9 additions & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ func TestListExpandDeveloper(t *testing.T) {

// kvm test
func TestCreateKVM(t *testing.T) {
name := "test"

cmd := exec.Command(apigeecli, "kvms", "create", "-o", org, "-e", env, "-n", name, "-t", token, "-l")
err := cmd.Run()
Expand Down Expand Up @@ -261,6 +260,15 @@ func TestDeleteTS(t *testing.T) {

}

func TestExportProducts(t *testing.T) {

cmd := exec.Command(apigeecli, "products", "export", "-o", org, "-t", token, "-l")
err := cmd.Run()
if err != nil {
t.Fatal(err)
}
}

//get requires an app id. run list and get an app id or get it from create
/*func TestGetApp(t *testing.T) {
cmd := exec.Command(apigeecli, "apps", "get", "-o", org, "-i", appID, "-t", token, "-l")
Expand Down
85 changes: 0 additions & 85 deletions products.json

This file was deleted.

0 comments on commit b297a3c

Please sign in to comment.