def test_initialize_2(self, tmpdir_factory):
var_dir = tmpdir_factory.mktemp('temp_var')
test_config = var_dir.join('paper-git.cfg')
with test_config.open(ensure=True, mode='w') as fp:
print("""
[dropbox]
api_token: thisisanotherapikey
""", file=fp)
assert config.dbox is None
assert config.db.path is None
with pytest.raises(peewee.OperationalError):
config.db.db.connect()
with var_dir.as_cwd():
initialize()
# Make sure that the database connection works.
assert config.db.path is not None
assert set(config.db.db.get_tables()) == set([
'paperdoc', 'paperfolder', 'sync'])
assert config.dbox is not None
评论列表
文章目录