def test_adopt(self): g = Grab(transport=GRAB_TRANSPORT) SERVER.RESPONSE['get'] = 'Moon' g.go(SERVER.BASE_URL) g2 = Grab(transport=GRAB_TRANSPORT) self.assertEqual(g2.config['url'], None) g2.adopt(g) self.assertTrue('Moon' in g2.response.body) self.assertEqual(g2.config['url'], SERVER.BASE_URL)
def test_empty_adopt(self): g = Grab() g2 = Grab() g2.adopt(g)