def test_person_not_indb(self): with self.assertRaises(Exception) as x: persons.scrape('asd') self.assertTrue(x.exception, Exception('username not in database'))
def test_alreadyscraped(self): a = persons.scrape('shaddygarg') a = persons.scrape('shaddygarg') self.assertEqual(a, persons.person.names['shaddygarg'].show())
def test_favs_not_exist(self): a = persons.scrape('swapnil.negi09') self.assertEqual(a, 'no favourites to show')
def test_favs_exist(self): a = persons.scrape('k4ni5h') self.assertEqual(type(a), type({}))
def test_work_not_exist(self): with self.assertRaises(AttributeError): persons.scrape('abk.maloo') persons.person.names['abk.maloo'].work