conduit r1297 - in trunk: . conduit/modules/GoogleModule test/python-tests
- From: jstowers svn gnome org
- To: svn-commits-list gnome org
- Subject: conduit r1297 - in trunk: . conduit/modules/GoogleModule test/python-tests
- Date: Sun, 10 Feb 2008 01:31:00 +0000 (GMT)
Author: jstowers
Date: Sun Feb 10 01:31:00 2008
New Revision: 1297
URL: http://svn.gnome.org/viewvc/conduit?rev=1297&view=rev
Log:
2008-02-10 John Stowers <john stowers gmail com>
* conduit/modules/GoogleModule/GoogleModule.py: Fix test. Import urllib2
* test/python-tests/TestCoreSyncLogic.py:
* test/python-tests/TestCoreSyncTestDataProviders.py:
* test/python-tests/TestSyncImageSync.py:
* test/python-tests/TestSyncTomboyFolder.py:
* test/python-tests/TestSyncTomboyiPod.py: Fix conflict tests.
Call set_two_way_sync_policy() after prepare()
Modified:
trunk/ChangeLog
trunk/conduit/modules/GoogleModule/GoogleModule.py
trunk/test/python-tests/TestCoreSyncLogic.py
trunk/test/python-tests/TestCoreSyncTestDataProviders.py
trunk/test/python-tests/TestSyncImageSync.py
trunk/test/python-tests/TestSyncTomboyFolder.py
trunk/test/python-tests/TestSyncTomboyiPod.py
Modified: trunk/conduit/modules/GoogleModule/GoogleModule.py
==============================================================================
--- trunk/conduit/modules/GoogleModule/GoogleModule.py (original)
+++ trunk/conduit/modules/GoogleModule/GoogleModule.py Sun Feb 10 01:31:00 2008
@@ -1,6 +1,7 @@
import gobject
import datetime
import dateutil.parser
+import urllib2
import vobject
from dateutil.tz import tzutc, tzlocal
import logging
Modified: trunk/test/python-tests/TestCoreSyncLogic.py
==============================================================================
--- trunk/test/python-tests/TestCoreSyncLogic.py (original)
+++ trunk/test/python-tests/TestCoreSyncLogic.py Sun Feb 10 01:31:00 2008
@@ -104,6 +104,7 @@
sourceDpw,
sinkDpw
)
+test.set_two_way_policy({"conflict":"ask","deleted":"ask"})
test.set_two_way_sync(True)
################################################################################
@@ -135,9 +136,10 @@
source.added = ['1','2','3']
sink.added = ['4','5']
+test.set_two_way_policy({"conflict":"ask","deleted":"ask"})
a,b = test.sync(debug=DB_DEBUG)
abort,error,conflict = test.get_sync_result()
-ok("2Way: Sync completed: phase one: add different data to each side", abort == False and error == False and conflict == False)
+ok("2Way: Sync completed: phase one: add different data to each side (no conflicts)", abort == False and error == False and conflict == False)
mappings = get_mappings(sourceDpw, sinkDpw)
ok("2Way: 5 mappings exist", len(mappings) == 5)
ok("2Way: 3x data put into sink", sink.num_put == 3 and sink.num_del == 0)
@@ -148,9 +150,10 @@
source.modified = ['4','5']
sink.modified = ['1','2']
+test.set_two_way_policy({"conflict":"ask","deleted":"ask"})
a,b = test.sync(debug=DB_DEBUG)
abort,error,conflict = test.get_sync_result()
-ok("2Way: Sync completed: phase two: modify some", abort == False and error == False and conflict == False)
+ok("2Way: Sync completed: phase two: modify some (no conflicts)", abort == False and error == False and conflict == False)
mappings = get_mappings(sourceDpw, sinkDpw)
ok("2Way: 5 mappings exist", len(mappings) == 5)
ok("2Way: 2x data put into sink", sink.num_put == 2 and sink.num_del == 0)
@@ -161,6 +164,7 @@
source.deleted = ['4']
sink.deleted = ['2']
+test.set_two_way_policy({"conflict":"skip","deleted":"skip"})
a,b = test.sync(debug=DB_DEBUG)
abort,error,conflict = test.get_sync_result()
ok("2Way: Sync completed: phase two: delete some (delete policy: skip)", abort == False and error == False and conflict == False)
Modified: trunk/test/python-tests/TestCoreSyncTestDataProviders.py
==============================================================================
--- trunk/test/python-tests/TestCoreSyncTestDataProviders.py (original)
+++ trunk/test/python-tests/TestCoreSyncTestDataProviders.py Sun Feb 10 01:31:00 2008
@@ -6,11 +6,11 @@
###
ok("---- ONE WAY: SHOULD ERROR", True)
test = SimpleSyncTest()
-test.set_two_way_policy({"conflict":"skip","deleted":"skip"})
test.prepare(
test.get_dataprovider("TestSource"),
test.get_dataprovider("TestSink")
)
+test.set_two_way_policy({"conflict":"skip","deleted":"skip"})
config = {}
config["numData"] = 5
config["errorAfter"] = 2
@@ -28,11 +28,11 @@
###
ok("---- ONE WAY: SHOULD ABORT (Fail Refresh)", True)
test = SimpleSyncTest()
-test.set_two_way_policy({"conflict":"skip","deleted":"skip"})
test.prepare(
test.get_dataprovider("TestSource"),
test.get_dataprovider("TestSinkFailRefresh")
)
+test.set_two_way_policy({"conflict":"skip","deleted":"skip"})
test.set_two_way_sync(False)
test.sync(debug=False)
@@ -44,11 +44,11 @@
###
ok("---- ONE WAY: SHOULD ABORT (Not Configured)", True)
test = SimpleSyncTest()
-test.set_two_way_policy({"conflict":"skip","deleted":"skip"})
test.prepare(
test.get_dataprovider("TestSource"),
test.get_dataprovider("TestSinkNeedConfigure")
)
+test.set_two_way_policy({"conflict":"skip","deleted":"skip"})
test.set_two_way_sync(False)
test.sync(debug=False)
@@ -60,11 +60,11 @@
###
ok("---- ONE WAY: SHOULD CONFLICT", True)
test = SimpleSyncTest()
-test.set_two_way_policy({"conflict":"ask","deleted":"skip"})
test.prepare(
test.get_dataprovider("TestSource"),
test.get_dataprovider("TestConflict")
)
+test.set_two_way_policy({"conflict":"ask","deleted":"skip"})
test.set_two_way_sync(False)
test.sync(debug=False)
@@ -78,11 +78,11 @@
###
ok("---- TWO WAY:", True)
test = SimpleSyncTest()
-test.set_two_way_policy({"conflict":"ask","deleted":"skip"})
test.prepare(
test.get_dataprovider("TestTwoWay"),
test.get_dataprovider("TestTwoWay")
)
+test.set_two_way_policy({"conflict":"ask","deleted":"skip"})
test.set_two_way_sync(True)
test.sync(debug=False)
@@ -94,7 +94,6 @@
###
ok("---- ONE WAY: MUCH DATA", True)
test = SimpleSyncTest()
-test.set_two_way_policy({"conflict":"skip","deleted":"skip"})
test.prepare(
test.get_dataprovider("TestSource"),
test.get_dataprovider("TestSink")
@@ -102,6 +101,7 @@
test.add_extra_sink(
test.get_dataprovider("TestSink")
)
+test.set_two_way_policy({"conflict":"skip","deleted":"skip"})
config = {}
config["numData"] = 500
@@ -118,11 +118,11 @@
###
ok("---- ONE WAY: CONVERSION ARGS", True)
test = SimpleSyncTest()
-test.set_two_way_policy({"conflict":"skip","deleted":"skip"})
test.prepare(
test.get_dataprovider("TestSource"),
test.get_dataprovider("TestConversionArgs")
)
+test.set_two_way_policy({"conflict":"skip","deleted":"skip"})
test.set_two_way_sync(False)
test.sync(debug=False)
aborted = test.sync_aborted()
@@ -133,7 +133,6 @@
###
ok("---- ONE WAY: TEST FILE/IMAGE SINK", True)
test = SimpleSyncTest()
-test.set_two_way_policy({"conflict":"ask","deleted":"ask"})
test.prepare(
test.get_dataprovider("TestFileSource"),
test.get_dataprovider("TestFileSink")
@@ -141,6 +140,7 @@
test.add_extra_sink(
test.get_dataprovider("TestImageSink")
)
+test.set_two_way_policy({"conflict":"ask","deleted":"ask"})
test.set_two_way_sync(False)
test.sync(debug=False)
aborted,errored,conflicted = test.get_sync_result()
@@ -151,11 +151,11 @@
###
ok("---- TWO WAY: TEST FILE", True)
test = SimpleSyncTest()
-test.set_two_way_policy({"conflict":"ask","deleted":"ask"})
test.prepare(
test.get_dataprovider("TestFileTwoWay"),
test.get_dataprovider("TestFileTwoWay")
)
+test.set_two_way_policy({"conflict":"ask","deleted":"ask"})
test.set_two_way_sync(True)
test.sync(debug=False)
aborted,errored,conflicted = test.get_sync_result()
@@ -167,14 +167,13 @@
###
ok("---- TWO WAY: TEST FILE", True)
test = SimpleSyncTest()
-test.set_two_way_policy({"conflict":"ask","deleted":"ask"})
-
#add a file to source and sink
source = test.get_dataprovider("TestFolderTwoWay")
source.module.add(None)
sink = test.get_dataprovider("TestFolderTwoWay")
sink.module.add(None)
test.prepare(source, sink)
+test.set_two_way_policy({"conflict":"ask","deleted":"ask"})
test.set_two_way_sync(True)
test.sync(debug=False)
aborted,errored,conflicted = test.get_sync_result()
Modified: trunk/test/python-tests/TestSyncImageSync.py
==============================================================================
--- trunk/test/python-tests/TestSyncImageSync.py (original)
+++ trunk/test/python-tests/TestSyncImageSync.py Sun Feb 10 01:31:00 2008
@@ -9,6 +9,7 @@
test.get_dataprovider("FileSource"),
test.get_dataprovider("TestImageSink")
)
+test.set_two_way_policy({"conflict":"ask","deleted":"ask"})
test.set_two_way_sync(False)
#add a file
Modified: trunk/test/python-tests/TestSyncTomboyFolder.py
==============================================================================
--- trunk/test/python-tests/TestSyncTomboyFolder.py (original)
+++ trunk/test/python-tests/TestSyncTomboyFolder.py Sun Feb 10 01:31:00 2008
@@ -4,13 +4,12 @@
import conduit.datatypes.File as File
import conduit.Utils as Utils
-test = SimpleSyncTest()
-test.set_two_way_policy({"conflict":"ask","deleted":"ask"})
-
#setup the conduit
+test = SimpleSyncTest()
sourceW = test.get_dataprovider("TomboyNoteTwoWay")
sinkW = test.get_dataprovider("FolderTwoWay")
test.prepare(sourceW, sinkW)
+test.set_two_way_policy({"conflict":"ask","deleted":"ask"})
#check if tomboy running
tomboy = sourceW.module
Modified: trunk/test/python-tests/TestSyncTomboyiPod.py
==============================================================================
--- trunk/test/python-tests/TestSyncTomboyiPod.py (original)
+++ trunk/test/python-tests/TestSyncTomboyiPod.py Sun Feb 10 01:31:00 2008
@@ -13,7 +13,6 @@
#setup the test
test = SimpleSyncTest()
-test.set_two_way_policy({"conflict":"replace","deleted":"replace"})
#Make a fake iPod so we dont damage a real one
fakeIpodDir = os.path.join(os.environ['TEST_DIRECTORY'],"iPod")
@@ -26,6 +25,7 @@
sourceW = test.get_dataprovider("TomboyNoteTwoWay")
sinkW = test.wrap_dataprovider(klass)
test.prepare(sourceW, sinkW)
+test.set_two_way_policy({"conflict":"replace","deleted":"replace"})
#check if tomboy running
tomboy = sourceW.module
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]