def test_softwareByNameError(self): """Should raise an exception when software was not found.""" softwares = self.__getSoftwares() query = Query(softwares) success = False try: query.softwareByName('E') except SoftwareNotFoundError: success = True self.assertTrue(success)
def test_softwareByName(self): """Should return a software instance by name.""" softwares = self.__getSoftwares() query = Query(softwares) for index, software in enumerate(softwares): self.assertEqual(query.softwareByName(software.name()), softwares[index])