Ejemplo n.º 1
0
 def test_normal2(self):
     ml = ModelLife(target_model=11,life_day = 70, force_life_day = 100)
     ml.save()
     
     deletemodels.deleteallmodels()
     
     self.assertEqual(70, SendSettingDEG.objects.all().count())
Ejemplo n.º 2
0
 def test_normal1(self):
     ml = ModelLife(target_model=10,life_day = 90, force_life_day = 100)
     ml.save()
     
     deletemodels.deleteallmodels()
     
     self.assertEqual(90, SendSettingBattery.objects.all().count())
Ejemplo n.º 3
0
 def test_normal1(self):
     ml = ModelLife(target_model=8,life_day = 90, force_life_day = 100)
     ml.save()
     
     deletemodels.deleteallmodels()
     
     self.assertEqual(90, Event.objects.all().count())
Ejemplo n.º 4
0
 def test_normal2(self):
     ml = ModelLife(target_model=7,life_day = 70, force_life_day = 100)
     ml.save()
     
     deletemodels.deleteallmodels()
     
     self.assertEqual(70, MeasuredPower.objects.all().count())
Ejemplo n.º 5
0
    def test_normal4(self):

            
        ml = ModelLife(target_model=0,life_day = 1, force_life_day = 10)
        ml.save()
        
        deletemodels.deleteallmodels()
        
        self.assertEqual(10, ControlResult.objects.all().count())
Ejemplo n.º 6
0
 def test_normal1(self):
     ml = ModelLife(target_model=0,life_day = 90, force_life_day = 100)
     ml.save()
     #for ress in ControlResult.objects.all():
     #    print ress.updatedate
     
     deletemodels.deleteallmodels()
     
     self.assertEqual(100-10, ControlResult.objects.all().count())
Ejemplo n.º 7
0
 def test_withrequest(self):
     for i in range(0,100):
         req = ControlRequest(id=i+100, controllerid=self.con, deviceindex=0, controltype=10, devicetype=1)
         req.save()
     
     ml = ModelLife(target_model=0,life_day = 1, force_life_day = 10)
     ml.save()
     
     deletemodels.deleteallmodels()
     
     self.assertEqual(10, ControlResult.objects.all().count())
     self.assertEqual(10, ControlRequest.objects.all().count())
Ejemplo n.º 8
0
 def test_normal1(self):
     for i in range(0,12):
         ml = ModelLife(target_model=i,life_day = 10+i, force_life_day = 10+i)
         ml.save()
         
     deletemodels.deleteallmodels()
     
     self.assertEqual(10, ControlResult.objects.all().count())
     self.assertEqual(11, MeasuredBattery.objects.all().count())
     self.assertEqual(12, MeasuredPV.objects.all().count())
     self.assertEqual(13, MeasuredGrid.objects.all().count())
     self.assertEqual(14, MeasuredDEG.objects.all().count())
     self.assertEqual(15, MeasuredLoad.objects.all().count())
     self.assertEqual(16, MeasuredTemperature.objects.all().count())
     self.assertEqual(17, MeasuredPower.objects.all().count())
     self.assertEqual(18, Event.objects.all().count())
     self.assertEqual(19, SendSettingController.objects.all().count())
     self.assertEqual(20, SendSettingBattery.objects.all().count())
     self.assertEqual(21, SendSettingDEG.objects.all().count())