Пример #1
0
    def test_resetting(self):
        big = Counter(count=999999)
        zero = Counter(count=0)
        neg = Counter(count=-10)
        big.reset()
        zero.reset()
        neg.reset()
        self.counter.reset()

        self.assertEqual(big.count, 0)
        self.assertEqual(zero.count, 0)
        self.assertEqual(neg.count, 0)
        self.assertEqual(self.counter.count, 0)
Пример #2
0
 def test_decrementing(self):
     negative = Counter(count=-999999)
     for i in range(10):
         self.counter.decrement()
         negative.decrement()
         self.assertEqual(self.counter.count, -(i + 1))
     self.assertEqual(negative.count, -999999 - 10)
Пример #3
0
 def test_incrementing(self):
     negative = Counter(count=-123)
     for i in range(10):
         self.counter.increment()
         negative.increment()
         self.assertEqual(self.counter.count, i + 1)
     self.assertEqual(negative.count, -123 + 10)
Пример #4
0
 def toDeliver(self):
     if not timerCocina:
         self.cooking = True
     if cooking:
         pedidoActual = Counter()
         timerDelivery = pedidoActual.delivery(self.dirDelivery)#This method caculates delivey time from store
         timerDelivery.empezar()
Пример #5
0
    def toKitchen(self, order):
        kitchenTxt = open('kitchenDisplay.txt', 'w+')
        kitchenTxt.write(self.choice)
        kitchenTxt.close()

        runningOrder = Counter()
        timerCocina = runningOrder.order(max(self.seleccion))
        timerCocina.start()
Пример #6
0
    def test_reading_from_file(self):
        self.counter.increment()
        self.counter.export_info("tests.cnt")

        self.zero = Counter(count=0, step=5)
        self.zero.import_info("tests.cnt")

        self.assertEqual(self.zero.count, self.counter.count)
        self.assertEqual(self.zero.step, self.counter.step)
Пример #7
0
 def setUp(self):
     self.counter = Counter()
Пример #8
0
 def test_starting_value(self):
     self.assertEqual(self.counter.count, 0)
     self.assertEqual(Counter(count=1000).count, 1000)
     self.assertEqual(Counter(count=-13).count, -13)