* ifstate: fix decoding of json numbers
When we read the static slots/plugs from the state we decode them
as with the default json decoding. This leads to float64 instead
of the expected int. This PR fixes it and adds tests.
It also adds support in NormalizeInterfaceAttributes for json.Number.
* interfaces: fix NormalizeInterfaceAttributes, add tests
The NormalizeInterfaceAttributes was untested so I fixed that. While
working on tests I noticed that it was unexpectedly mutating the
argument it was given (while returning a return value) so I fixed and
tested that as well.
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
* interfaces: test normalization of float32
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
* interfaces: add tests for CopyAttributes
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>