Example #1
0
    def test_stock_subtract_positive_integer_too_much(self):
        res2 = ep.stock_add(self.stock_item['item_id'], self.rand_int_pos)

        self.assertTrue(res2.ok)

        res3 = ep.stock_subtract(self.stock_item['item_id'],
                                 self.rand_int_pos + 1)

        self.assertFalse(res3.ok)
        self.assertEqual(
            ep.stock_find(self.item_id).json()['stock'], self.rand_int_pos)
Example #2
0
    def test_stock_subtract_negative_integer(self):
        res2 = ep.stock_add(self.stock_item['item_id'], self.rand_int_neg)
        new_amount = ep.stock_find(self.item_id).json()['stock']

        self.assertFalse(res2.ok)
        self.assertEqual(new_amount, self.old_amount)
Example #3
0
    def test_stock_subtract_positive_float(self):
        res2 = ep.stock_add(self.stock_item['item_id'], self.rand_float_pos)
        new_amount = ep.stock_find(self.item_id).json()['stock']

        self.assertFalse(res2.ok)
        self.assertEqual(new_amount, self.old_amount)