socialpredict
socialpredict copied to clipboard
Setup Testing
Test the setup of the EconomicConfig
struct marshaling by creating a yaml file and loading it.
One benefit would be that it highlights the full workflow (i.e. load valid yaml file that gets translated to object, start app with settings).
Add a function UnmarshalEconomicConfig
(example: https://pkg.go.dev/encoding/json#Unmarshal) and MarshalEconomicConfig
to setup.go. The Unmarshal function will be very similar to the code that's currently in setup.LoadEconomicsConfig.
Once these are added, add a test to setup_test.go (may need to be created), to validate that these work correctly for both valid and invalid yaml files.