<file_sep>def calculate_discount(item_cost, relative_discount, absolute_discount):

    if item_cost < 0:
        raise ValueError("Item cost cannot be negative")
    elif item_cost == 0:
        raise ValueError("Item cost cannot be zero")

    if relative_discount < 0:
        raise ValueError("Relative discount cannot be negative")
    elif relative_discount > 100:
        raise ValueError("Relative discount cannot be more than 100")

    if absolute_discount < 0:
        raise ValueError("Absolute discount cannot be negative")
    elif absolute_discount > item_cost:
        raise ValueError("Absolute discount cannot be more than item cost")

    final_price = item_cost - (item_cost * relative_discount/100) - absolute_discount

    if final_price < 0:
        raise ValueError("Final price cannot be negative")

    return final_price

<file_sep>import unittest

from discount_calculator import calculate_discount

class DiscountCalculatorTests(unittest.TestCase):

    def testNegativeItemCost(self):
        with self.assertRaises(ValueError):
            final_price = calculate_discount(-200, 10, 30)

    def testZeroItemCost(self):
        with self.assertRaises(ValueError):
            final_price = calculate_discount(0, 10, 30)

    def testNegativeRelativeDiscount(self):
        with self.assertRaises(ValueError):
            final_price = calculate_discount(200, -10, 30)

    def testZeroRelativeDiscount(self):
        final_price = calculate_discount(200, 0, 30)
        self.assertEqual(final_price, 170)

    def testLargeRelativeDiscount(self):
        with self.assertRaises(ValueError):
            final_price = calculate_discount(200, 110, 30)

    def testNegativeAbsoluteDiscount(self):
        with self.assertRaises(ValueError):
            final_price = calculate_discount(200, 10, -30)

    def testZeroAbsoluteDiscount(self):
        final_price = calculate_discount(200, 10, 0)
        self.assertEqual(final_price, 180)

    def testLargeAbsoluteDiscount(self):
        with self.assertRaises(ValueError):
            final_price = calculate_discount(200, 10, 300)

    def testNegativeFinalPrice(self):
        with self.assertRaises(ValueError):
            final_price = calculate_discount(200, 75, 75)

    def testZeroFinalPrice(self):
        final_price = calculate_discount(200, 50, 100)
        self.assertEqual(final_price, 0)

    def testCorrectFinalPrice(self):
        final_price = calculate_discount(200, 10, 30)
        self.assertEqual(final_price, 150)

if __name__ == '__main__':
    unittest.main(verbosity=2)

