@@ -31,30 +31,29 @@ class TestStorageWiring(unittest.TestCase):
3131 def setUp (self ):
3232 self ._tmp = tempfile .TemporaryDirectory ()
3333 self .env_path = self ._tmp .name
34+ self .app = Application (port = 8097 , env_path = self .env_path )
3435
3536 def tearDown (self ):
3637 self ._tmp .cleanup ()
3738
3839 def test_application_has_json_store (self ):
39- app = Application (port = 8097 , env_path = self .env_path )
40- self .assertIsInstance (app .storage , DataStore )
41- self .assertIsInstance (app .storage , JSONStore )
42- self .assertEqual (app .storage .env_path , self .env_path )
40+ self .assertIsInstance (self .app .storage , DataStore )
41+ self .assertIsInstance (self .app .storage , JSONStore )
42+ self .assertEqual (self .app .storage .env_path , self .env_path )
4343
4444 def test_save_routes_through_storage (self ):
45- app = Application (port = 8097 , env_path = self .env_path )
4645 calls = []
47- real_save_envs = app .storage .save_envs
46+ real_save_envs = self . app .storage .save_envs
4847
4948 def spy (state , eids ):
5049 calls .append (list (eids ))
5150 return real_save_envs (state , eids )
5251
53- app .storage .save_envs = spy
52+ self . app .storage .save_envs = spy
5453
5554 written = []
5655 handler = types .SimpleNamespace (
57- storage = app .storage , state = app .state , write = written .append
56+ storage = self . app .storage , state = self . app .state , write = written .append
5857 )
5958 SaveHandler .wrap_func (handler , {"data" : ["main" ]})
6059
0 commit comments