(t *testing.T)
| 75 | } |
| 76 | |
| 77 | func TestLoadModelFromConfig(t *testing.T) { |
| 78 | m := NewModel() |
| 79 | err := m.loadModelFromConfig(basicConfig) |
| 80 | if err != nil { |
| 81 | t.Error("basic config should not return an error") |
| 82 | } |
| 83 | m = NewModel() |
| 84 | err = m.loadModelFromConfig(&MockConfig{}) |
| 85 | if err == nil { |
| 86 | t.Error("empty config should return error") |
| 87 | } else { |
| 88 | // check for missing sections in message |
| 89 | for _, rs := range requiredSections { |
| 90 | if !strings.Contains(err.Error(), sectionNameMap[rs]) { |
| 91 | t.Errorf("section name: %s should be in message", sectionNameMap[rs]) |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | func TestHasSection(t *testing.T) { |
| 98 | m := NewModel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…