GODT-949: Fix section parsing issue

This commit is contained in:
Jakub
2021-06-01 09:35:20 +02:00
parent 858f2c7f29
commit cf1ba6588a
6 changed files with 19 additions and 87 deletions

View File

@ -98,17 +98,12 @@ func TestParseBodyStructurePGP(t *testing.T) {
bs, err := NewBodyStructure(bytes.NewReader(b))
require.NoError(t, err)
paths := []string{}
haveStructure := map[string]string{}
for path := range *bs {
paths = append(paths, path)
}
sort.Strings(paths)
for _, path := range paths {
require.Equal(t, expectedStructure[path], (*bs)[path].Header.Get("Content-Type"))
haveStructure[path] = (*bs)[path].Header.Get("Content-Type")
}
require.True(t, len(*bs) == len(expectedStructure), "Wrong number of sections expected %d but have %d", len(expectedStructure), len(*bs))
require.Equal(t, expectedStructure, haveStructure)
}
func TestGetSection(t *testing.T) {