Skip to content

Commit

Permalink
Removed references to testify package (#837)
Browse files Browse the repository at this point in the history
  • Loading branch information
thom-at-redhat authored Sep 7, 2023
1 parent e25f8ef commit 3273e5a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: CI

on:
pull_request:
on: # yamllint disable-line rule:truthy
pull_request: # yamllint disable-line rule:empty-values

jobs:
lint-receptor:
Expand All @@ -29,6 +29,8 @@ jobs:

- name: Setup up python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install tox
run: pip install tox
Expand Down Expand Up @@ -149,6 +151,8 @@ jobs:

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install python dependencies
run: pip install build
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ require (
github.com/quic-go/quic-go v0.34.0
github.com/rogpeppe/go-internal v1.10.0
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8
github.com/stretchr/testify v1.8.1
github.com/vishvananda/netlink v1.1.0
golang.org/x/net v0.9.0
gopkg.in/yaml.v2 v2.4.0
Expand Down Expand Up @@ -51,7 +50,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/ginkgo/v2 v2.9.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/quic-go/qtls-go1-19 v0.3.2 // indirect
github.com/quic-go/qtls-go1-20 v0.2.2 // indirect
github.com/spf13/pflag v1.0.5 // indirect
Expand Down
27 changes: 19 additions & 8 deletions pkg/controlsvc/reload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package controlsvc

import (
"testing"

"github.com/stretchr/testify/assert"
)

func TestReload(t *testing.T) {
Expand All @@ -22,22 +20,35 @@ func TestReload(t *testing.T) {
{filename: "reload_test_yml/successful_reload.yml", modifyError: false, absentError: false},
}
err := parseConfigForReload("reload_test_yml/init.yml", false)
assert.NoError(t, err)
assert.Len(t, cfgNotReloadable, 5)
if err != nil {
t.Errorf("parseConfigForReload %s: Unexpected err: %v", "init.yml", err)
}

if len(cfgNotReloadable) != 5 {
t.Errorf("cfNotReloadable length expected %d, got %d", 5, len(cfgNotReloadable))
}

for _, s := range scenarios {
t.Logf("%s", s.filename)
err = parseConfigForReload(s.filename, true)
if s.modifyError {
assert.Error(t, err)
if err == nil {
t.Errorf("parseConfigForReload %s %s: Expected err, got %v", s.filename, "modifyError", err)
}
} else {
assert.NoError(t, err)
if err != nil {
t.Errorf("parseConfigForReload %s %s: Unexpected err: %v", s.filename, "modifyError", err)
}
}
err = cfgAbsent()
if s.absentError {
assert.Error(t, err)
if err == nil {
t.Errorf("parseConfigForReload %s %s: Expected err, got %v", s.filename, "absentError", err)
}
} else {
assert.NoError(t, err)
if err != nil {
t.Errorf("parseConfigForReload %s %s: Unexpected err: %v", s.filename, "absentError", err)
}
}
}
}

0 comments on commit 3273e5a

Please sign in to comment.