Ejemplo n.º 1
0
 def test_calc_none_bucket(self):
     with self.assertRaisesRegex(ab.ABTestError, "saw <class 'NoneType'>"):
         ab.calc(None, buckets=2)
Ejemplo n.º 2
0
 def test_calc_100_buckets(self):
     self.assertEqual(ab.calc(99, buckets=100), 60)
Ejemplo n.º 3
0
 def test_calc_3_buckets(self):
     self.assertEqual(ab.calc(99, buckets=3), 1)
     self.assertEqual(ab.calc(98, buckets=3), 0)
Ejemplo n.º 4
0
 def test_calc_zero_2_buckets(self):
     self.assertEqual(ab.calc(0, buckets=2), 1)
Ejemplo n.º 5
0
 def test_calc_1_bucket(self):
     with self.assertRaisesRegex(ab.ABTestError, 'saw 1'):
         ab.calc(0, buckets=1)
Ejemplo n.º 6
0
 def test_calc_negative_bucket(self):
     with self.assertRaisesRegex(ab.ABTestError, 'saw -1'):
         ab.calc(0, buckets=-1)