-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github action workflows for test coverage
- Loading branch information
1 parent
b29cb21
commit 8eb439b
Showing
3 changed files
with
6 additions
and
20 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 |
---|---|---|
@@ -1,26 +1,9 @@ | ||
package config_test | ||
|
||
import ( | ||
"os" | ||
"qdrant/config" | ||
"testing" | ||
|
||
"github.com/joho/godotenv" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGetEnviron(t *testing.T) { | ||
err := godotenv.Load("test.env") | ||
assert.Nil(t, err) | ||
|
||
expectedValue := "TestValue" | ||
os.Setenv("TEST_VARIABLE", expectedValue) | ||
|
||
result := config.GetEnviron("TEST_VARIABLE") | ||
assert.Equal(t, expectedValue, result) | ||
|
||
result = config.GetEnviron("NON_EXISTING_VARIABLE") | ||
assert.Empty(t, result) | ||
|
||
os.Unsetenv("TEST_VARIABLE") | ||
} |
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