예제 #1
0
파일: tests.py 프로젝트: mrmagooey/gossamer
 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'))
예제 #2
0
파일: tests.py 프로젝트: mrmagooey/gossamer
 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'))