mailr6504 - /1.3/test_suite/system_tests/model_free.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on June 28, 2008 - 17:21:
Author: bugman
Date: Sat Jun 28 17:15:53 2008
New Revision: 6504

URL: http://svn.gna.org/viewcvs/relax?rev=6504&view=rev
Log:
Created an object which mimics the file object by providing the write() 
method.

This is to catch the output of the results.write() method and to store it in 
a string.


Modified:
    1.3/test_suite/system_tests/model_free.py

Modified: 1.3/test_suite/system_tests/model_free.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/model_free.py?rev=6504&r1=6503&r2=6504&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/model_free.py (original)
+++ 1.3/test_suite/system_tests/model_free.py Sat Jun 28 17:15:53 2008
@@ -859,3 +859,17 @@
         self.assertEqual(spin.g_count, g_count, msg=mesg)
         self.assertEqual(spin.h_count, h_count, msg=mesg)
         self.assertEqual(spin.warning, warning, msg=mesg)
+
+
+class File_mimick:
+    def __init__(self):
+        """Initialise an object for adding the string from all write calls 
to."""
+
+        self.data = ''
+
+
+    def write(self, str):
+        """Mimic the file object write() method so that this class can be 
used as a file object."""
+
+        # Append the string to the data object.
+        self.data = self.data + str




Related Messages


Powered by MHonArc, Updated Sat Jun 28 17:40:19 2008