1   
  2   
  3   
  4   
  5   
  6   
  7   
  8   
  9   
 10   
 11   
 12   
 13   
 14   
 15   
 16   
 17   
 18   
 19   
 20   
 21   
 22   
 23   
 24  from unittest import TestCase 
 25   
 26   
 27  from prompt.interpreter import Interpreter 
 28  from relax_errors import RelaxListStrError, RelaxNoneStrError, RelaxStrError 
 29  from test_suite.unit_tests.model_free_testing_base import Model_free_base_class 
 30   
 31   
 32  from data_types import DATA_TYPES 
 33   
 34   
 36      """Unit tests for the functions of the 'prompt.model_free' module.""" 
 37   
 51   
 52   
 54          """The model arg test of the model_free.create_model() user function.""" 
 55   
 56           
 57          for data in DATA_TYPES: 
 58               
 59              if data[0] == 'str': 
 60                  continue 
 61   
 62               
 63              self.assertRaises(RelaxStrError, self.model_free_fns.create_model, model=data[1]) 
  64   
 65   
 67          """The equation arg test of the model_free.create_model() user function.""" 
 68   
 69           
 70          for data in DATA_TYPES: 
 71               
 72              if data[0] == 'str': 
 73                  continue 
 74   
 75               
 76              self.assertRaises(RelaxStrError, self.model_free_fns.create_model, equation=data[1]) 
  77   
 78   
 80          """The params arg test of the model_free.create_model() user function.""" 
 81   
 82           
 83          for data in DATA_TYPES: 
 84               
 85              if data[0] == 'str list': 
 86                  continue 
 87   
 88               
 89              self.assertRaises(RelaxListStrError, self.model_free_fns.create_model, model='test', equation='test', params=data[1]) 
  90   
 91   
 93          """The spin_id arg test of the model_free.create_model() user function.""" 
 94   
 95           
 96          for data in DATA_TYPES: 
 97               
 98              if data[0] == 'None' or data[0] == 'str': 
 99                  continue 
100   
101               
102              self.assertRaises(RelaxNoneStrError, self.model_free_fns.create_model, model='test', equation='test', params=['test'], spin_id=data[1]) 
 103   
104   
106          """The spin_id arg test of the model_free.remove_tm() user function.""" 
107   
108           
109          for data in DATA_TYPES: 
110               
111              if data[0] == 'None' or data[0] == 'str': 
112                  continue 
113   
114               
115              self.assertRaises(RelaxNoneStrError, self.model_free_fns.remove_tm, spin_id=data[1]) 
 116   
117   
119          """The model arg test of the model_free.select_model() user function.""" 
120   
121           
122          for data in DATA_TYPES: 
123               
124              if data[0] == 'str': 
125                  continue 
126   
127               
128              self.assertRaises(RelaxStrError, self.model_free_fns.select_model, model=data[1]) 
 129   
130   
132          """The spin_id arg test of the model_free.select_model() user function.""" 
133   
134           
135          for data in DATA_TYPES: 
136               
137              if data[0] == 'None' or data[0] == 'str': 
138                  continue 
139   
140               
141              self.assertRaises(RelaxNoneStrError, self.model_free_fns.select_model, model='test', spin_id=data[1]) 
  142