mirror of https://github.com/status-im/consul.git
Update snapshot inspect formatter test
This commit is contained in:
parent
eafc593d0f
commit
5f5b49955c
|
@ -13,6 +13,11 @@ func TestFormat(t *testing.T) {
|
||||||
Sum: 1,
|
Sum: 1,
|
||||||
Count: 2,
|
Count: 2,
|
||||||
}}
|
}}
|
||||||
|
mkv := []typeStats{{
|
||||||
|
Name: "msgKV",
|
||||||
|
Sum: 1,
|
||||||
|
Count: 2,
|
||||||
|
}}
|
||||||
info := OutputFormat{
|
info := OutputFormat{
|
||||||
Meta: &MetadataInfo{
|
Meta: &MetadataInfo{
|
||||||
ID: "one",
|
ID: "one",
|
||||||
|
@ -21,9 +26,12 @@ func TestFormat(t *testing.T) {
|
||||||
Term: 4,
|
Term: 4,
|
||||||
Version: 1,
|
Version: 1,
|
||||||
},
|
},
|
||||||
Stats: m,
|
Stats: m,
|
||||||
TotalSize: 1,
|
StatsKV: mkv,
|
||||||
|
TotalSize: 1,
|
||||||
|
TotalSizeKV: 1,
|
||||||
}
|
}
|
||||||
|
detailed := false
|
||||||
|
|
||||||
formatters := map[string]Formatter{
|
formatters := map[string]Formatter{
|
||||||
"pretty": newPrettyFormatter(),
|
"pretty": newPrettyFormatter(),
|
||||||
|
@ -33,7 +41,7 @@ func TestFormat(t *testing.T) {
|
||||||
|
|
||||||
for fmtName, formatter := range formatters {
|
for fmtName, formatter := range formatters {
|
||||||
t.Run(fmtName, func(t *testing.T) {
|
t.Run(fmtName, func(t *testing.T) {
|
||||||
actual, err := formatter.Format(&info)
|
actual, err := formatter.Format(&info, detailed)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
gName := fmt.Sprintf("%s", fmtName)
|
gName := fmt.Sprintf("%s", fmtName)
|
||||||
|
|
Loading…
Reference in New Issue