def test_get_path():
    assert Config.get_datastore_path("choka.csv")
    assert Config.get_download_path("choka_daikoku_2021_04_001.html")
    assert Config.test_resource("daikoku1.html")
    assert Config.get_url("daikoku")
    assert Config.get_download_file("daikoku", 2021, 4)
    assert Config.get_db_path()
    assert Config.get_config_path("config.toml")
Beispiel #2
0
 def __init__(self, db_name=config.ChokaDB):
     """
     SQLite3 データベースへの接続と、各モデル定義を初期化します
     """
     self.db_path = Config.get_db_path(db_name)
     self.db = ds.connect('sqlite:///{}'.format(self.db_path))
     self.target = pd.DataFrame(columns=['Target', 'Species'])
     self.area = pd.DataFrame(columns=['Point', 'PointName'])
Beispiel #3
0
 def __init__(self, db_name=config.ChokaDB):
     """
     SQLite3 データベースへの接続と、各モデル定義を初期化します
     """
     self.db_path = Config.get_db_path(db_name)
     db = ds.connect('sqlite:///{}'.format(self.db_path))
     self.db = db
     self.tables = [
         Table('fishing_results', ['Date', 'Point', 'Species'],
               'choka.csv'),
         Table('fishing_comments', ['Date', 'Point'], 'comment.csv'),
         Table('fishing_newslines', ['Date', 'Time', 'Point'],
               'newsline.csv'),
     ]
     self.load_counts = dict()
Beispiel #4
0
 def __init__(self, db_name=config.ChokaDB):
     """
     SQLite3 データベースへの接続と、各モデル定義を初期化します
     """
     self.db_path = Config.get_db_path(db_name)
     self.db = ds.connect('sqlite:///{}'.format(self.db_path))
def test_get_choka_db():
    print(Config.get_db_path())
def test_init():
    Datastore(TEST_DB).reset_database()
    db_path = Config.get_db_path(TEST_DB)
    assert not os.path.exists(db_path)