コード例 #1
0
 def setUp(self):
     min_freq = 0.1
     max_freq = .7
     most_likely = .3
     kurtosis = 1
     low_loss = 1
     high_loss = 10
     self.s = pertloss.PERTLoss(low_loss, high_loss, min_freq, max_freq, most_likely, kurtosis=kurtosis)
コード例 #2
0
 def testLowHighLoss(self):
     # High loss must exceed low loss
     with self.assertRaises(AssertionError):
         pertloss.PERTLoss(100, 10, .1, .7, .3)  # min > max
コード例 #3
0
 def testMostLikelyFrequency(self):
     # Most likely frequency must be between min and max.
     with self.assertRaises(AssertionError):
         pertloss.PERTLoss(10, 100, .1, .7, .8)  # most_likely > max
コード例 #4
0
 def testMinMaxFrequency(self):
     # Min must be less than max.
     with self.assertRaises(AssertionError):
         pertloss.PERTLoss(10, 100, .7, .1, .3)  # min > max