Skip to content

Commit f5ac071

Browse files
authored
Fixed some tests so they work with latest FastAPI version of server (#563)
* Fixed some tests so they work with latest FastAPI version of server * Updated .snyk with extension of SNYK-GOLANG-GOLANGORGXCRYPTOSSHAGENT-12668891
1 parent 589d135 commit f5ac071

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

.snyk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ignore:
1111
SNYK-GOLANG-GOLANGORGXCRYPTOSSHAGENT-12668891:
1212
- "*":
1313
reason: No fix available
14-
expires: 2025-10-17T05:18:46.481Z
14+
expires: 2025-11-17T05:18:46.481Z
1515
created: 2025-09-17T05:18:46.483Z
1616
patch: {}
1717
exclude:

cmd/kosli/getDeployment_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ func (suite *GetDeploymentCommandTestSuite) TestGetDeploymentCmd() {
6666
"Usage: kosli get deployment EXPRESSION [flags]\n",
6767
},
6868
{
69-
wantError: true,
70-
name: "get deployment fails when flow does not exist",
71-
cmd: `get deployment foo#1` + suite.defaultKosliArguments,
72-
golden: "Error: Flow named 'foo' does not exist for organization 'docs-cmd-test-user'. \n",
69+
wantError: true,
70+
name: "get deployment fails when flow does not exist",
71+
cmd: `get deployment foo#1` + suite.defaultKosliArguments,
72+
goldenRegex: "^Error: Flow named 'foo' does not exist for organization 'docs-cmd-test-user'",
7373
},
7474
{
7575
wantError: true,

cmd/kosli/getEnvironment_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ func (suite *GetEnvironmentCommandTestSuite) TestGetEnvironmentCmd() {
4444
golden: "",
4545
},
4646
{
47-
wantError: true,
48-
name: "trying to get non-existing env fails",
49-
cmd: "get environment non-existing" + suite.defaultKosliArguments,
50-
golden: "Error: Environment named 'non-existing' does not exist for organization 'docs-cmd-test-user'. \n",
47+
wantError: true,
48+
name: "trying to get non-existing env fails",
49+
cmd: "get environment non-existing" + suite.defaultKosliArguments,
50+
goldenRegex: "^Error: Environment named 'non-existing' does not exist for organization 'docs-cmd-test-user'",
5151
},
5252
{
5353
wantError: true,

cmd/kosli/listDeployments_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ func (suite *ListDeploymentsCommandTestSuite) TestListDeploymentsCmd() {
5656
golden: "Error: required flag(s) \"flow\" not set\n",
5757
},
5858
{
59-
wantError: true,
60-
name: "non-existing flow causes an error",
61-
cmd: fmt.Sprintf(`list deployments --flow non-existing %s`, suite.defaultKosliArguments),
62-
golden: "Error: Flow named 'non-existing' does not exist for organization 'docs-cmd-test-user'\n",
59+
wantError: true,
60+
name: "non-existing flow causes an error",
61+
cmd: fmt.Sprintf(`list deployments --flow non-existing %s`, suite.defaultKosliArguments),
62+
goldenRegex: "^Error: Flow named 'non-existing' does not exist for organization 'docs-cmd-test-user'",
6363
},
6464
// TODO: the correct error is overwritten by the hack flag value check in root.go
6565
{
@@ -91,9 +91,9 @@ func (suite *ListDeploymentsCommandTestSuite) TestListDeploymentsCmd() {
9191
golden: "No deployments were found at page number 2.\n",
9292
},
9393
{
94-
name: "listing deployments on an empty flow with --output json works",
95-
cmd: fmt.Sprintf(`list deployments --flow %s --output json %s`, suite.flowName1, suite.defaultKosliArguments),
96-
golden: "[]\n",
94+
name: "listing deployments on an empty flow with --output json works",
95+
cmd: fmt.Sprintf(`list deployments --flow %s --output json %s`, suite.flowName1, suite.defaultKosliArguments),
96+
goldenJson: []jsonCheck{{"", "[]"}},
9797
},
9898
{
9999
name: "listing deployments on a flow works",

0 commit comments

Comments
 (0)