Example #1
0
def test_already_upgraded(tmpdir, metadata_store):
    pony_db_path = Path(tmpdir) / 'test.db'
    my_key = default_eccrypto.generate_key("curve25519")
    metadata_store.shutdown()

    assert not already_upgraded(pony_db_path)

    mds = MetadataStore(pony_db_path, tmpdir, my_key)
    with db_session:
        mds.MiscData(name=CONVERSION_FROM_72, value=CONVERSION_FINISHED)
    mds.shutdown()

    assert already_upgraded(pony_db_path)
Example #2
0
    def test_already_upgraded(self):
        pony_db = self.session_base_dir / 'pony.db'
        my_key = default_eccrypto.generate_key(u"curve25519")
        mds = MetadataStore(pony_db, self.session_base_dir, my_key)
        mds.shutdown()

        self.assertFalse(already_upgraded(pony_db))

        mds = MetadataStore(pony_db, self.session_base_dir, my_key)
        with db_session:
            mds.MiscData(name=CONVERSION_FROM_72, value=CONVERSION_FINISHED)
        mds.shutdown()

        self.assertTrue(already_upgraded(pony_db))