From: Martin Jansa Date: Thu, 29 Mar 2012 23:36:56 +0200 Subject: [PATCH] opkg.py: improve test so it prints temporary control file with long description and then reads it back Signed-off-by: Martin Jansa --- opkg.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/opkg.py b/opkg.py index 2294160..27cbc2a 100644 --- a/opkg.py +++ b/opkg.py @@ -509,11 +509,21 @@ if __name__ == "__main__": package.set_architecture("arm") package.set_maintainer("Testing ") package.set_depends("libc") - package.set_description("A test of the APIs.") + package.set_description("A test of the APIs. And very long descriptions so often used in oe-core\nfoo\n\n\nbar") print("<") sys.stdout.write(str(package)) print(">") + f = open("/tmp/control", "w") + f.write(str(package)) + f.close() + + f = open("/tmp/control", "r") + package2 = Package() + package2.read_control(f) + print("<") + sys.stdout.write(str(package2)) + print(">") package.write_package("/tmp")