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