File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ class ProdConfig(Config):
2424 MINUTES_BEFORE_TIMEOUT = "1"
2525 SECONDS_BETWEEN_SHUTDOWNS = "10"
2626 DATA_FOLDER_PATH = "/data/"
27- SQLALCHEMY_DATABASE_URI = f"sqlite:///{ os .path .join (DATA_FOLDER_PATH , 'db.sqlite3' )} "
27+ SQLALCHEMY_DATABASE_URI = (
28+ f"sqlite:///{ os .path .join (DATA_FOLDER_PATH , 'db.sqlite3' )} "
29+ )
2830
2931
3032class DevConfig (Config ):
@@ -33,4 +35,6 @@ class DevConfig(Config):
3335 MINUTES_BEFORE_TIMEOUT = "1"
3436 SECONDS_BETWEEN_SHUTDOWNS = "10"
3537 DATA_FOLDER_PATH = "./data/"
36- SQLALCHEMY_DATABASE_URI = f"sqlite:///{ os .path .join (DATA_FOLDER_PATH , 'db.sqlite3' )} "
38+ SQLALCHEMY_DATABASE_URI = (
39+ f"sqlite:///{ os .path .join (DATA_FOLDER_PATH , 'db.sqlite3' )} "
40+ )
Original file line number Diff line number Diff line change 44
55initialized = False
66
7+
78def init_db (app ):
89 global initialized
910 if initialized :
10- return db
11- print ('DB' , app .config .get ("SQLALCHEMY_DATABASE_URI" ))
11+ return db
12+ print ("DB" , app .config .get ("SQLALCHEMY_DATABASE_URI" ))
1213 db .init_app (app )
1314 with app .app_context ():
1415 db .create_all ()
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def client():
2626 app .config ["REQUEST_COUNTER" ] = 0
2727 app .config ["LAST_REQUEST_TIME" ] = time .time ()
2828 BASE_DIR = os .path .abspath (os .path .dirname (__file__ ))
29- db_path = os .path .join (BASE_DIR , "data" , "project.db" )
29+ db_path = os .path .join (BASE_DIR , "data" , "project.db" )
3030 app .config ["SQLALCHEMY_DATABASE_URI" ] = f"sqlite:///{ db_path } "
3131
3232 print ("Current working directory:" , os .getcwd ())
Original file line number Diff line number Diff line change @@ -113,7 +113,9 @@ def test_save_all_viewables_and_return_info(client):
113113 assert db_entry is not None
114114 assert db_entry .name == data .name ()
115115 assert db_entry .native_file_name == os .path .basename (result ["native_file_name" ])
116- assert db_entry .viewable_file_name == os .path .basename (result ["viewable_file_name" ])
116+ assert db_entry .viewable_file_name == os .path .basename (
117+ result ["viewable_file_name" ]
118+ )
117119 assert db_entry .light_viewable == os .path .basename (db_entry .light_viewable )
118120 assert db_entry .geode_object == geode_object
119121 assert db_entry .input_files == additional_files
You can’t perform that action at this time.
0 commit comments