From e102c5e9921d83b8e6459f234712d07cd8ee2509 Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 6 Feb 2017 10:29:59 +0100 Subject: [PATCH] Tests to verify the handling of filename and path attrs. --- Lib/designSpaceDocument/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Lib/designSpaceDocument/__init__.py b/Lib/designSpaceDocument/__init__.py index 5fa3d4575..f684b6368 100644 --- a/Lib/designSpaceDocument/__init__.py +++ b/Lib/designSpaceDocument/__init__.py @@ -1312,6 +1312,12 @@ if __name__ == "__main__": >>> s.styleName = "MasterStyleNameOne" >>> doc.addSource(s) >>> doc.write(testDocPath1) + >>> verify = DesignSpaceDocument() + >>> verify.read(testDocPath1) + >>> print(verify.sources[0].filename) + None + >>> print(verify.sources[0].path) + None >>> doc = DesignSpaceDocument() >>> s = SourceDescriptor() @@ -1323,6 +1329,12 @@ if __name__ == "__main__": >>> s.styleName = "MasterStyleNameOne" >>> doc.addSource(s) >>> doc.write(testDocPath2) + >>> verify = DesignSpaceDocument() + >>> verify.read(testDocPath2) + >>> print(verify.sources[0].filename) + masters/masterTest1.ufo + >>> verify.sources[0].path == masterPath1 + True >>> doc = DesignSpaceDocument() >>> s = SourceDescriptor() @@ -1334,6 +1346,8 @@ if __name__ == "__main__": >>> s.styleName = "MasterStyleNameOne" >>> doc.addSource(s) >>> doc.write(testDocPath3) + >>> verify = DesignSpaceDocument() + >>> verify.read(testDocPath3) >>> doc = DesignSpaceDocument() >>> s = SourceDescriptor()