unit tests new entities/abc

This commit is contained in:
breel
2020-08-09 14:25:14 -06:00
parent 360a686906
commit 02c5d795cf
4 changed files with 119 additions and 37 deletions

View File

@@ -55,6 +55,13 @@ func (o One) Peers() []string {
return ids
}
func (o One) Generic() bson.M {
b, _ := bson.Marshal(o)
var m bson.M
bson.Unmarshal(b, &m)
return m
}
func (o One) MarshalBSON() ([]byte, error) {
isMin := fmt.Sprint(o) == fmt.Sprint(o.Query())
if !isMin {