def test_softwaresByAddonNameError(self): """Should raise an exception when addon name was not found.""" softwares = self.__getSoftwares() query = Query(softwares) success = False try: query.softwaresByAddonName('B') except AddonNotFoundError: success = True self.assertTrue(success)
def test_softwaresByAddonName(self): """Should return a list of softwares based on the addon name.""" softwares = self.__getSoftwares() query = Query(softwares) softwareList = query.softwaresByAddonName('A') self.assertEqual(len(softwareList), 2) for software in softwareList: self.assertIn(software.name(), ['B', 'C'])