PricedItem evolved
This commit is contained in:
@@ -63,9 +63,16 @@ func TestPricedComputeResource_GetPriceHT(t *testing.T) {
|
||||
start := time.Now()
|
||||
end := start.Add(1 * time.Hour)
|
||||
r := resources.PricedComputeResource{
|
||||
PricedResource: resources.PricedResource{
|
||||
ResourceID: "comp456",
|
||||
SelectedPricing: &MockPricingProfile{ReturnCost: 1.0},
|
||||
PricedResource: resources.PricedResource[*resources.ComputeResourcePricingProfile]{
|
||||
ResourceID: "comp456",
|
||||
SelectedPricing: &resources.ComputeResourcePricingProfile{
|
||||
CPUsPrices: map[string]float64{"Xeon": 2.0},
|
||||
ExploitPricingProfile: pricing.ExploitPricingProfile[pricing.TimePricingStrategy]{
|
||||
AccessPricingProfile: pricing.AccessPricingProfile[pricing.TimePricingStrategy]{
|
||||
Pricing: pricing.PricingStrategy[pricing.TimePricingStrategy]{Price: 1.0},
|
||||
},
|
||||
},
|
||||
},
|
||||
BookingConfiguration: &resources.BookingConfiguration{
|
||||
UsageStart: &start,
|
||||
UsageEnd: &end,
|
||||
@@ -73,8 +80,8 @@ func TestPricedComputeResource_GetPriceHT(t *testing.T) {
|
||||
},
|
||||
},
|
||||
CPUsLocated: map[string]float64{"Xeon": 2},
|
||||
GPUsLocated: map[string]float64{"Tesla": 1},
|
||||
RAMLocated: 4,
|
||||
GPUsLocated: map[string]float64{},
|
||||
RAMLocated: 0,
|
||||
}
|
||||
|
||||
price, err := r.GetPriceHT()
|
||||
@@ -84,7 +91,7 @@ func TestPricedComputeResource_GetPriceHT(t *testing.T) {
|
||||
|
||||
func TestPricedComputeResource_GetPriceHT_MissingProfile(t *testing.T) {
|
||||
r := resources.PricedComputeResource{
|
||||
PricedResource: resources.PricedResource{
|
||||
PricedResource: resources.PricedResource[*resources.ComputeResourcePricingProfile]{
|
||||
ResourceID: "comp789",
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user