[extensions-web: 30/75] Make sure to close files properly in the tests
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web: 30/75] Make sure to close files properly in the tests
- Date: Fri, 23 Sep 2011 03:16:56 +0000 (UTC)
commit 1ec2c873ec26e8f9770eca89512b2c1828ed4146
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Sep 14 18:41:57 2011 -0400
Make sure to close files properly in the tests
sweettooth/extensions/tests.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/sweettooth/extensions/tests.py b/sweettooth/extensions/tests.py
index f193e23..514f91e 100644
--- a/sweettooth/extensions/tests.py
+++ b/sweettooth/extensions/tests.py
@@ -34,7 +34,8 @@ class UploadTest(TestCase):
version = models.ExtensionVersion()
version.extension = extension
- metadata = models.parse_zipfile_metadata(get_test_zipfile('SimpleExtension'))
+ with get_test_zipfile('SimpleExtension') as f:
+ metadata = models.parse_zipfile_metadata(f)
version.parse_metadata_json(metadata)
self.assertEquals(extension.name, "Test Extension")
@@ -46,7 +47,8 @@ class UploadTest(TestCase):
version = models.ExtensionVersion()
version.extension = extension
- metadata = models.parse_zipfile_metadata(get_test_zipfile('ExtraMetadata'))
+ with get_test_zipfile('ExtraMetadata') as f:
+ metadata = models.parse_zipfile_metadata(f)
version.parse_metadata_json(metadata)
extra = json.loads(version.extra_json_fields)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]