def testCurrSpotPrice(self): stop_date = dt.datetime.now().isoformat() start_date = (dt.datetime.now()-dt.timedelta(hours=1680)).isoformat() result=spc.get_periodic_spot_price(["Linux/UNIX"], ["t1.micro"], ["us-west-2"], ["us-west-2a"], "none", "json",1,168, start_date , stop_date) assert isinstance(result[0]['price'],float) #assert len(result)==10 or len(result)==9 or len(result)==11 pass
def testCurrSpotPrice(self): result=spc.get_current_spot_price(["Linux/UNIX"], ["t1.micro"], ["us-west-2"], [], "none", "json") assert isinstance(result[0]['price'],float) pass
def testCurrSpotPrice(self): price=spc.get_current_us_west_2_spot_price("m1.medium") print ("Current price of m1.medium is %s"%price) assert isinstance(price,float) pass
def testCurrSpotPrice(self): price=spc.get_average_us_west_2_spot_price("m1.medium",24) print ("Average m1.medium price is %s over past 24 hour duration"%price) assert isinstance(price,float) pass
def testCurrSpotPrice(self): start_date = (dt.datetime.now()-dt.timedelta(hours=1704)).isoformat() price=spc.get_average_us_west_2_periodic_spot_price("m1.medium",24,start_date,168) print ("Average Weekly m1.medium price is %s over past 10 weeks"%price) assert isinstance(price,float) pass