Beispiel #1
0
 def test_bolo(self):
     with self.subTest(count=0):
         self.assertEqual(
             pricing.price_in_cents(make_reservation(outside_bolo=0)), 0)
     with self.subTest(count=1):
         self.assertEqual(
             pricing.price_in_cents(make_reservation(outside_bolo=1),
                                    outside_bolo=6), 6)
     with self.subTest(count=2):
         self.assertEqual(
             pricing.price_in_cents(make_reservation(outside_bolo=2),
                                    outside_bolo=6), 12)
     with self.subTest(count=3):
         self.assertEqual(
             pricing.price_in_cents(make_reservation(outside_bolo=3)), 3600)
Beispiel #2
0
 def test_scampis(self):
     with self.subTest(count=0):
         self.assertEqual(
             pricing.price_in_cents(make_reservation(outside_scampis=0)), 0)
     with self.subTest(count=1):
         self.assertEqual(
             pricing.price_in_cents(make_reservation(outside_scampis=1),
                                    outside_scampis=6), 6)
     with self.subTest(count=2):
         self.assertEqual(
             pricing.price_in_cents(make_reservation(outside_scampis=2),
                                    outside_scampis=6), 12)
     with self.subTest(count=3):
         self.assertEqual(
             pricing.price_in_cents(make_reservation(outside_scampis=3)),
             5100)
Beispiel #3
0
 def test_tiramisu(self):
     with self.subTest(count=0):
         self.assertEqual(
             pricing.price_in_cents(make_reservation(outside_tiramisu=0)),
             0)
     with self.subTest(count=1):
         self.assertEqual(
             pricing.price_in_cents(make_reservation(outside_tiramisu=1),
                                    outside_tiramisu=6), 6)
     with self.subTest(count=2):
         self.assertEqual(
             pricing.price_in_cents(make_reservation(outside_tiramisu=2),
                                    outside_tiramisu=6), 12)
     with self.subTest(count=3):
         self.assertEqual(
             pricing.price_in_cents(make_reservation(outside_tiramisu=3)),
             1800)
Beispiel #4
0
 def test_combinations_pricing(self):
     for combination, expected in (({
             'inside_bolo': 2,
             'inside_scampis': 3
     }, 14000), ({
             'inside_bolo': 2,
             'inside_scampis': 3,
             'outside_bolo': 1
     }, 15200), ({
             'inside_bolo': 2,
             'inside_scampis': 3,
             'outside_tranches': 2,
             'outside_bolo': 1
     }, 16400), ({
             'inside_bolo': 1,
             'inside_scampis': 2,
             'outside_assiettes': 1,
             'outside_tranches': 2,
             'outside_bolo': 1
     }, 11800), ({
             'outside_assiettes': 3,
             'outside_bolo': 4
     }, 7500), ({
             'outside_fondus': 1,
             'outside_assiettes': 2
     }, 2700), ({
             'outside_fondus': 1,
             'outside_assiettes': 1,
             'outside_tiramisu': 1,
             'outside_tranches': 1
     }, 3000), ({
             'outside_assiettes': 1,
             'outside_bolo': 1,
             'outside_tranches': 1
     }, 2700), ({
             'outside_assiettes': 1,
             'outside_scampis': 1,
             'outside_tranches': 1
     }, 3200), ({
             'outside_fondus': 2,
             'outside_scampis': 2,
             'outside_tiramisu': 2
     }, 6400), ({
             'outside_fondus': 2,
             'outside_scampis': 2,
             'outside_bolo': 1,
             'outside_tiramisu': 2
     }, 7600), ({
             'outside_fondus': 2,
             'outside_scampis': 1,
             'outside_bolo': 1,
             'outside_tiramisu': 2,
             'outside_tranches': 1
     }, 6500)):
         with self.subTest(**combination):
             self.assertEqual(
                 pricing.price_in_cents(make_reservation(**combination)),
                 expected)