summaryrefslogtreecommitdiff
path: root/unotest
diff options
context:
space:
mode:
Diffstat (limited to 'unotest')
-rw-r--r--unotest/source/python/org/libreoffice/unotest.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/unotest/source/python/org/libreoffice/unotest.py b/unotest/source/python/org/libreoffice/unotest.py
index c5cfa596ee53..1f5f7d1c4202 100644
--- a/unotest/source/python/org/libreoffice/unotest.py
+++ b/unotest/source/python/org/libreoffice/unotest.py
@@ -161,6 +161,37 @@ class UnoConnection:
finally:
self.connection = None
+class UnoNotConnection:
+ def __init__(self, args):
+ self.args = args
+ def getContext(self):
+ return self.xContext
+ def getDoc(self):
+ return self.xDoc
+ def setUp(self):
+ self.xContext = pyuno.getComponentContext()
+ pyuno.experimentalExtraMagic()
+ def openEmptyWriterDoc(self):
+ assert(self.xContext)
+ smgr = self.getContext().ServiceManager
+ desktop = smgr.createInstanceWithContext("com.sun.star.frame.Desktop", self.getContext())
+ props = [("Hidden", True), ("ReadOnly", False)]
+ loadProps = tuple([mkPropertyValue(name, value) for (name, value) in props])
+ self.xDoc = desktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, loadProps)
+ assert(self.xDoc)
+ return self.xDoc
+
+ def checkProperties(self, obj, dict, test):
+ for k,v in dict.items():
+ obj.setPropertyValue(k, v)
+ value = obj.getPropertyValue(k)
+ test.assertEqual(value, v)
+
+ def postTest(self):
+ assert(self.xContext)
+ def tearDown(self):
+ self.xDoc.close(True)
+
def simpleInvoke(connection, test):
try:
connection.preTest()