[conduit/syncml: 11/13] Start working on syncml passing tests
- From: John Carr <johncarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [conduit/syncml: 11/13] Start working on syncml passing tests
- Date: Sat, 27 Jun 2009 15:24:13 +0000 (UTC)
commit bc77a102a9ad856f78714c7285a92032cdf2884b
Author: John Carr <john carr unrouted co uk>
Date: Mon Jun 8 11:09:31 2009 +0100
Start working on syncml passing tests
conduit/modules/SyncmlModule/SyncmlModule.py | 7 +++++++
test/soup/data/event.py | 2 ++
test/soup/modules/syncml.py | 13 +++++++++++--
3 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/conduit/modules/SyncmlModule/SyncmlModule.py b/conduit/modules/SyncmlModule/SyncmlModule.py
index eca46c1..77eaa49 100644
--- a/conduit/modules/SyncmlModule/SyncmlModule.py
+++ b/conduit/modules/SyncmlModule/SyncmlModule.py
@@ -213,6 +213,8 @@ class SyncmlDataProvider(DataProvider.TwoWay):
DataProvider.TwoWay.__init__(self)
self.address = address
+ self.running = False
+
self.anchor = {}
self.mapping = {}
self.slowsync = False
@@ -232,6 +234,7 @@ class SyncmlDataProvider(DataProvider.TwoWay):
self._queue = None
def refresh(self):
+ self.running = True
self._queue = []
self._syncml_run()
@@ -276,6 +279,9 @@ class SyncmlDataProvider(DataProvider.TwoWay):
self._queue.append((enums.SML_CHANGE_DELETE, LUID, self.mapping[LUID], ""))
def finish(self, a, b, c):
+ if not self.running:
+ return
+
self._put_lock.set()
self._refresh_lock.wait(60)
self._refresh_lock.clear()
@@ -293,6 +299,7 @@ class SyncmlDataProvider(DataProvider.TwoWay):
self.syncobj.unref(pysyncml.byref(self.syncobj))
self._queue = None
+ self.running = False
def get_UID(self):
return self.address
diff --git a/test/soup/data/event.py b/test/soup/data/event.py
index 0b6de79..7b6f6e0 100644
--- a/test/soup/data/event.py
+++ b/test/soup/data/event.py
@@ -11,6 +11,8 @@ class EventWrapper(soup.data.DataWrapper):
def iter_samples(self):
for f in self.get_files_from_data_dir("*.ical"):
+ if f.endswith("1.ical"):
+ continue
txt = open(f).read()
e = Event.Event()
e.set_from_ical_string(txt)
diff --git a/test/soup/modules/syncml.py b/test/soup/modules/syncml.py
index a7cdfaf..4e5eee9 100644
--- a/test/soup/modules/syncml.py
+++ b/test/soup/modules/syncml.py
@@ -9,6 +9,7 @@ import conduit.modules.SyncmlModule.SyncmlModule as SyncmlModule
import os
import subprocess
import signal
+import shutil
server_path = os.path.join(soup.get_root(), "test", "python-tests")
server_script = os.path.join(server_path, "syncml-server.sh")
@@ -44,8 +45,12 @@ class SyncmlContacts(soup.modules.ModuleWrapper, SyncmlBase):
dir = os.path.join(server_path, "contacts")
def create_dataprovider(self):
+ shutil.rmtree(self.dir)
self.server = subprocess.Popen([server_script, "text/x-vcard", "Contacts", "contacts"], cwd=server_path)
- return self.klass()
+ dp = self.klass()
+ dp.username = "test"
+ dp.password = "test"
+ return dp
def destroy_dataprovider(self):
os.kill(self.server.pid, signal.SIGINT)
@@ -58,8 +63,12 @@ class SyncmlCalendar(soup.modules.ModuleWrapper, SyncmlBase):
dir = os.path.join(server_path, "calendar")
def create_dataprovider(self):
+ shutil.rmtree(self.dir)
self.server = subprocess.Popen([server_script, "text/x-vcalendar", "Calendar", "calendar"], cwd=server_path)
- return self.klass()
+ dp = self.klass()
+ dp.username = "test"
+ dp.password = "test"
+ return dp
def destroy_dataprovider(self):
os.kill(self.server.pid, signal.SIGINT)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]