def save_file(self): lazy_path = LazyPath(self.url) lazy_path.save(self.response.text)
def test_create_lazy_path(self): url = LazyUrl('stackoverflow.com') path = LazyPath(url) self.assertIn(path.rel, 'stackoverflow.com') self.assertTrue(os.path.exists(path.getpath()))