def test_local_file_storage(self): s = Silk(self.io_loop) s.fetch_and_save(LOCAL_URL%(LOCAL_PORT,'index.html'), self.stop) response = self.wait() s.get_local_file(LOCAL_URL%(LOCAL_PORT,'index.html'), self.stop) local_file = self.wait() self.assertEqual(response.body, local_file.body) s.delete_local_file(LOCAL_URL%(LOCAL_PORT,'index.html'))
def test_debug_setting(self): """ Test that with debug=True that files are being saved to the local disk. """ s = Silk(self.io_loop, debug=True) s.get(LOCAL_URL%(LOCAL_PORT,'index.html'), self.stop) response = self.wait() s.get_local_file(LOCAL_URL%(LOCAL_PORT,'index.html'), self.stop) cached_response = self.wait() self.assertEqual(response.body, cached_response.body) s.delete_local_file(LOCAL_URL%(LOCAL_PORT,'index.html'))