(t *testing.T)
| 136 | } |
| 137 | |
| 138 | func TestLoadConfigSetsUUID(t *testing.T) { |
| 139 | cfg := New() |
| 140 | |
| 141 | if blob, err := json.Marshal(&cfg); err == nil { |
| 142 | if err = os.WriteFile("./config.json", blob, 0644); err != nil { |
| 143 | t.Fatalf("Failed to write default config.json: %v", err) |
| 144 | } |
| 145 | defer os.Remove("./config.json") |
| 146 | } else { |
| 147 | t.Fatalf("Failed to serialize %v", err) |
| 148 | } |
| 149 | |
| 150 | loadedCfg, err := LoadConfig() |
| 151 | if err != nil { |
| 152 | t.Fatal(err) |
| 153 | } |
| 154 | |
| 155 | if loadedCfg.UUID == "" { |
| 156 | t.Error("loaded config should have a UUID but was empty") |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | func TestDefaultResources(t *testing.T) { |
| 161 | // Check that giving empty resources results in empty resources |
nothing calls this directly
no test coverage detected