mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
fix syncing tests
This commit is contained in:
parent
f7790275ce
commit
eac9a00b22
1 changed files with 10 additions and 10 deletions
|
@ -49,7 +49,7 @@ def test_meta():
|
||||||
return
|
return
|
||||||
assert mod
|
assert mod
|
||||||
assert scm
|
assert scm
|
||||||
assert mod != ts.client.deck.mod
|
assert mod != ts.client.col.mod
|
||||||
assert abs(tstamp - time.time()) < 3
|
assert abs(tstamp - time.time()) < 3
|
||||||
|
|
||||||
@nose.with_setup(setup_remote)
|
@nose.with_setup(setup_remote)
|
||||||
|
@ -65,7 +65,7 @@ def test_hkey():
|
||||||
def test_download():
|
def test_download():
|
||||||
if not TEST_REMOTE:
|
if not TEST_REMOTE:
|
||||||
return
|
return
|
||||||
f = FullSyncer(ts.client.deck, "abc")
|
f = FullSyncer(ts.client.col, "abc")
|
||||||
assertException(Exception, f.download)
|
assertException(Exception, f.download)
|
||||||
f.hkey = TEST_HKEY
|
f.hkey = TEST_HKEY
|
||||||
f.download()
|
f.download()
|
||||||
|
@ -77,21 +77,21 @@ def test_remoteSync():
|
||||||
# not yet associated, so will require a full sync
|
# not yet associated, so will require a full sync
|
||||||
assert ts.client.sync() == "fullSync"
|
assert ts.client.sync() == "fullSync"
|
||||||
# upload
|
# upload
|
||||||
f = FullSyncer(ts.client.deck, TEST_HKEY)
|
f = FullSyncer(ts.client.col, TEST_HKEY)
|
||||||
f.upload()
|
f.upload()
|
||||||
ts.client.deck.reopen()
|
ts.client.col.reopen()
|
||||||
# should report no changes
|
# should report no changes
|
||||||
assert ts.client.sync() == "noChanges"
|
assert ts.client.sync() == "noChanges"
|
||||||
# bump local deck
|
# bump local col
|
||||||
ts.client.deck.save()
|
ts.client.col.save()
|
||||||
assert ts.client.sync() == "success"
|
assert ts.client.sync() == "success"
|
||||||
# again, no changes
|
# again, no changes
|
||||||
assert ts.client.sync() == "noChanges"
|
assert ts.client.sync() == "noChanges"
|
||||||
# downloading the remote deck should give us the same mod
|
# downloading the remote col should give us the same mod
|
||||||
lmod = ts.client.deck.mod
|
lmod = ts.client.col.mod
|
||||||
f = FullSyncer(ts.client.deck, TEST_HKEY)
|
f = FullSyncer(ts.client.col, TEST_HKEY)
|
||||||
f.download()
|
f.download()
|
||||||
d = aopen(ts.client.deck.path)
|
d = aopen(ts.client.col.path)
|
||||||
assert d.mod == lmod
|
assert d.mod == lmod
|
||||||
|
|
||||||
# Remote media tests
|
# Remote media tests
|
||||||
|
|
Loading…
Reference in a new issue