fixed sync unit test

This commit is contained in:
Damien Elmes 2010-12-10 18:02:18 +09:00
parent 75da977026
commit c4c9847028

View file

@ -229,7 +229,7 @@ def test_localsync_media():
shutil.rmtree(tmpdir) shutil.rmtree(tmpdir)
except OSError: except OSError:
pass pass
shutil.copytree(os.path.join(os.getcwd(), shutil.copytree(os.path.join(os.path.dirname(__file__), "..",
"tests/syncing/media-tests"), "tests/syncing/media-tests"),
tmpdir) tmpdir)
deck1anki = os.path.join(tmpdir, "1.anki") deck1anki = os.path.join(tmpdir, "1.anki")
@ -252,8 +252,6 @@ def test_localsync_media():
assert len(os.listdir(deck2media)) == 3 assert len(os.listdir(deck2media)) == 3
# check delete # check delete
os.unlink(os.path.join(deck1media, "22161b29b0c18e068038021f54eee1ee.png")) os.unlink(os.path.join(deck1media, "22161b29b0c18e068038021f54eee1ee.png"))
os.system("sync")
time.sleep(0.2)
rebuildMediaDir(deck1) rebuildMediaDir(deck1)
client.sync() client.sync()
assert deck1.s.scalar("select count(1) from media") == 2 assert deck1.s.scalar("select count(1) from media") == 2