oc-lib/models/resources/processing/processing_test.go

39 lines
943 B
Go
Raw Normal View History

2024-07-18 11:51:12 +02:00
package processing
2024-07-26 08:27:09 +02:00
/*
2024-07-18 11:51:12 +02:00
func TestStoreOneProcessing(t *testing.T) {
2024-07-19 10:54:58 +02:00
p := ProcessingResource{Container: "totoCont",
2024-07-18 11:51:12 +02:00
AbstractResource: resources.AbstractResource{
2024-07-19 10:54:58 +02:00
AbstractObject: utils.AbstractObject{Name: "testData"},
Description: "Lorem Ipsum",
Logo: "azerty.com",
Owner: "toto",
OwnerLogo: "totoLogo",
SourceUrl: "azerty.fr",
2024-07-18 11:51:12 +02:00
},
}
sma := ProcessingMongoAccessor{}
2024-07-19 11:27:58 +02:00
id, _, _ := sma.StoreOne(&p)
2024-07-18 11:51:12 +02:00
assert.NotEmpty(t, id)
}
func TestLoadOneProcessing(t *testing.T) {
2024-07-19 10:54:58 +02:00
p := ProcessingResource{Container: "totoCont",
2024-07-18 11:51:12 +02:00
AbstractResource: resources.AbstractResource{
2024-07-19 10:54:58 +02:00
AbstractObject: utils.AbstractObject{Name: "testData"},
Description: "Lorem Ipsum",
Logo: "azerty.com",
Owner: "toto",
OwnerLogo: "totoLogo",
SourceUrl: "azerty.fr",
2024-07-18 11:51:12 +02:00
},
}
sma := ProcessingMongoAccessor{}
2024-07-19 11:27:58 +02:00
new_s, _, _ := sma.StoreOne(&p)
2024-07-18 11:51:12 +02:00
assert.Equal(t, p, new_s)
}
2024-07-26 08:27:09 +02:00
*/