mailRe: r22470 - /trunk/test_suite/system_tests/relax_disp.py


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

Header


Content

Posted by Edward d'Auvergne on March 12, 2014 - 17:54:
Hi Troels,

For a code simplification here, you could use the
self.assertNotEqual() method (see
http://docs.python.org/3/library/unittest.html#unittest.TestCase.assertNotEqual).
 An even better way to test the file contents is to have a list of
strings of the file contents hardcoded into the system test, and to
check the generated content compared to the expected content.  Have a
look at the Structure.test_read_write_pdb_1UBQ system test for a good
example.  I use this file content hardcoding quite a lot.  It is a
more comprehensive test and will check key ordering, different
architectures, etc.  The file produced should be identical on all
systems.  You should then check if the test passes on different
operating systems or CPU architectures (virtual machines are very
useful for this).

Cheers,

Edward



On 12 March 2014 16:14,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Wed Mar 12 16:14:27 2014
New Revision: 22470

URL: http://svn.gna.org/viewcvs/relax?rev=22470&view=rev
Log:
Extended systemtest 
Relax_disp.test_value_write_calc_rotating_frame_params_auto_analysis() to 
test the writing of theta values.

Regarding sr #3124, (https://gna.org/support/index.php?3124) - Grace graphs 
production for R1rho analysis with R2_eff as function of Omega_eff.

Modified:
    trunk/test_suite/system_tests/relax_disp.py

Modified: trunk/test_suite/system_tests/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=22470&r1=22469&r2=22470&view=diff
==============================================================================
--- trunk/test_suite/system_tests/relax_disp.py (original)
+++ trunk/test_suite/system_tests/relax_disp.py Wed Mar 12 16:14:27 2014
@@ -3954,4 +3954,54 @@
         self.assert_(access(theta_filepath, F_OK))
         self.assert_(access(w_eff_filepath, F_OK))

-
+        # Open the files for testing.
+        theta_file = open(theta_filepath, 'r')
+
+        # Loop over the theta file to test values.
+        for line in theta_file:
+            # Skip lines starting with #.
+            if line[0] == "#":
+                continue
+
+            # Split the line
+            linesplit = line.split()
+
+            # Print lines, not including newline character.
+            print(linesplit[:6])
+
+            # Assume values
+            if linesplit[0] == "None" and linesplit[1] == "13" and 
linesplit[2] == "L":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "15" and 
linesplit[2] == "R":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "16" and 
linesplit[2] == "T":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "25" and 
linesplit[2] == "Q":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "26" and 
linesplit[2] == "Q":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "28" and 
linesplit[2] == "Q":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "39" and 
linesplit[2] == "L":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "40" and 
linesplit[2] == "M":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "41" and 
linesplit[2] == "A":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "43" and 
linesplit[2] == "F":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "44" and 
linesplit[2] == "I":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "45" and 
linesplit[2] == "K":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "49" and 
linesplit[2] == "A":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "52" and 
linesplit[2] == "V":
+                self.assert_(linesplit[5] != "None")
+            elif linesplit[0] == "None" and linesplit[1] == "53" and 
linesplit[2] == "A":
+                self.assert_(linesplit[5] != "None")
+
+        # Close files
+        theta_file.close()
+
+


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits



Related Messages


Powered by MHonArc, Updated Wed Mar 12 23:40:16 2014