mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
add resync test, fix zip meta
This commit is contained in:
parent
b4fdf1c690
commit
afe1ad2b0b
2 changed files with 10 additions and 1 deletions
|
@ -301,7 +301,7 @@ create table log (fname text primary key, type int);
|
|||
else:
|
||||
data = z.read(i)
|
||||
csum = checksum(data)
|
||||
name = meta[i.filename]['name']
|
||||
name = meta[i.filename]
|
||||
# malicious chars?
|
||||
for c in '/\\':
|
||||
assert c not in name
|
||||
|
|
|
@ -372,3 +372,12 @@ def test_media():
|
|||
client.sync()
|
||||
assert len(os.listdir(deck1.media.dir())) == 2
|
||||
assert server.mediatest("count") == 2
|
||||
# if we lose our media db, we should be able to bring it back in sync
|
||||
time.sleep(1)
|
||||
deck1.media.close()
|
||||
os.unlink(deck1.media.dir()+".db")
|
||||
deck1.media.connect()
|
||||
assert len(deck1.media.added().fetchall()) == 2
|
||||
client.sync()
|
||||
assert len(os.listdir(deck1.media.dir())) == 2
|
||||
assert server.mediatest("count") == 2
|
||||
|
|
Loading…
Reference in a new issue