[Python-checkins] r57239 - sandbox/trunk/import_in_py/tests/test_fs_loader.py

brett.cannon python-checkins at python.org
Tue Aug 21 05:40:24 CEST 2007


Author: brett.cannon
Date: Tue Aug 21 05:40:24 2007
New Revision: 57239

Modified:
   sandbox/trunk/import_in_py/tests/test_fs_loader.py
Log:
Test for get_data for the source loader.


Modified: sandbox/trunk/import_in_py/tests/test_fs_loader.py
==============================================================================
--- sandbox/trunk/import_in_py/tests/test_fs_loader.py	(original)
+++ sandbox/trunk/import_in_py/tests/test_fs_loader.py	Tue Aug 21 05:40:24 2007
@@ -296,7 +296,12 @@
         self.assertRaises(ImportError, loader.get_source, self.module_name)
 
     def test_get_data(self):
-        raise NotImplementedError
+        loader = importlib._PyFileLoader(self.module_name, self.pyc_path,
+                                            False)
+        data = loader.get_data(self.pyc_path)
+        with open(self.pyc_path, 'rb') as bytecode_file:
+            original = bytecode_file.read()
+        self.assertEqual(data, original)
 
     def test_is_package(self):
         raise NotImplementedError


More information about the Python-checkins mailing list