def delivery_tax(): district = input("Please type your district to calculate delivery tax: ") tax = database.delivery_tax(district) if not tax[0]: print("Sorry, we do not send to this district") return False else: print("Your delivery tax will be " + str(tax[1])) return True
def test_delivery_tax_unexisting_district(self): self.assertEqual((False, 0), database.delivery_tax('Lulin'))
def test_delivery_tax_existing_district(self): database.add_district('Lulin', 4) self.assertEqual((True, 4), database.delivery_tax('Lulin'))