From 49d0f41b403009b1fe513c4e46d350de0fdfd254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 23 Feb 2018 14:26:07 +0100 Subject: [PATCH] Test using BlendFile as context --- tests/test_blendfile_loading.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_blendfile_loading.py b/tests/test_blendfile_loading.py index 3cae760..f7ef64e 100644 --- a/tests/test_blendfile_loading.py +++ b/tests/test_blendfile_loading.py @@ -208,6 +208,15 @@ class LoadCompressedTest(AbstractBlendFileTest): name = ob.get((b'id', b'name')) self.assertEqual('OBümlaut', name) + def test_as_context(self): + with blendfile.BlendFile(self.blendfiles / 'basic_file_compressed.blend') as bf: + filepath = bf.filepath + raw_filepath = bf.raw_filepath + + self.assertTrue(bf.fileobj.closed) + self.assertTrue(filepath.exists()) + self.assertFalse(raw_filepath.exists()) + class LoadNonBlendfileTest(AbstractBlendFileTest): def test_loading(self):