-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flytepropeller] Add test under flytepropeller/manager (#4237)
Signed-off-by: Chao-Heng Lee <[email protected]>
- Loading branch information
1 parent
96e3497
commit 60cf95e
Showing
5 changed files
with
350 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package config | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGetConfig(t *testing.T) { | ||
assert.Equal(t, DefaultConfig, GetConfig()) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package shardstrategy | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestEnvironmentHashCode(t *testing.T) { | ||
expectedStrategy := &EnvironmentShardStrategy{ | ||
EnvType: Project, | ||
PerShardIDs: [][]string{ | ||
{"flytesnacks"}, | ||
{"flytefoo", "flytebar"}, | ||
{"*"}, | ||
}, | ||
} | ||
actualStrategy := &EnvironmentShardStrategy{ | ||
EnvType: Project, | ||
PerShardIDs: [][]string{ | ||
{"flytesnacks"}, | ||
{"flytefoo", "flytebar"}, | ||
{"*"}, | ||
}, | ||
} | ||
expectedHashcode, err := expectedStrategy.HashCode() | ||
assert.NoError(t, err) | ||
actualHashcode, err := actualStrategy.HashCode() | ||
assert.NoError(t, err) | ||
assert.Equal(t, expectedHashcode, actualHashcode) | ||
} |
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