testgenie-py 0.2.9__py3-none-any.whl → 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,263 @@
1
+ import unittest
2
+
3
+ import testgen.code_to_test.code_to_fuzz as code_to_fuzz
4
+
5
+ class TestNone(unittest.TestCase):
6
+
7
+ def test_random_fuzz_code_0(self):
8
+ args = (1927227313, 775789320)
9
+ expected = 1151437993
10
+ result = code_to_fuzz.random_fuzz_code(*args)
11
+ self.assertEqual(result, expected)
12
+
13
+ def test_random_fuzz_code_1(self):
14
+ args = (1359311181, 1603562853)
15
+ expected = 2962874034
16
+ result = code_to_fuzz.random_fuzz_code(*args)
17
+ self.assertEqual(result, expected)
18
+
19
+ def test_bin_and_2(self):
20
+ args = (False, False)
21
+ expected = False
22
+ result = code_to_fuzz.bin_and(*args)
23
+ self.assertEqual(result, expected)
24
+
25
+ def test_bin_and_3(self):
26
+ args = (True, True)
27
+ expected = True
28
+ result = code_to_fuzz.bin_and(*args)
29
+ self.assertEqual(result, expected)
30
+
31
+ def test_bin_and_4(self):
32
+ args = (True, False)
33
+ expected = False
34
+ result = code_to_fuzz.bin_and(*args)
35
+ self.assertEqual(result, expected)
36
+
37
+ def test_pos_or_neg_5(self):
38
+ args = 1381971091
39
+ expected = 1
40
+ result = code_to_fuzz.pos_or_neg(args)
41
+ self.assertEqual(result, expected)
42
+
43
+ def test_pos_or_neg_6(self):
44
+ args = -1792272568
45
+ expected = -1
46
+ result = code_to_fuzz.pos_or_neg(args)
47
+ self.assertEqual(result, expected)
48
+
49
+ def test_int_even_7(self):
50
+ args = 612556544
51
+ expected = True
52
+ result = code_to_fuzz.int_even(args)
53
+ self.assertEqual(result, expected)
54
+
55
+ def test_int_even_8(self):
56
+ args = 1538337835
57
+ expected = False
58
+ result = code_to_fuzz.int_even(args)
59
+ self.assertEqual(result, expected)
60
+
61
+ def test_http_code_9(self):
62
+ args = 1748799535
63
+ expected = 'invalid'
64
+ result = code_to_fuzz.http_code(args)
65
+ self.assertEqual(result, expected)
66
+
67
+ def test_add_or_subtract_10(self):
68
+ args = (1167731537, 1136934405)
69
+ expected = 30797132
70
+ result = code_to_fuzz.add_or_subtract(*args)
71
+ self.assertEqual(result, expected)
72
+
73
+ def test_add_or_subtract_11(self):
74
+ args = (506636609, 1260222214)
75
+ expected = 1766858823
76
+ result = code_to_fuzz.add_or_subtract(*args)
77
+ self.assertEqual(result, expected)
78
+
79
+ def test_bin_and_bad_generated_function_12(self):
80
+ args = (False, False)
81
+ expected = False
82
+ result = code_to_fuzz.bin_and_bad_generated_function(*args)
83
+ self.assertEqual(result, expected)
84
+
85
+ def test_bin_and_bad_generated_function_13(self):
86
+ args = (True, True)
87
+ expected = True
88
+ result = code_to_fuzz.bin_and_bad_generated_function(*args)
89
+ self.assertEqual(result, expected)
90
+
91
+ def test_bin_and_bad_generated_function_14(self):
92
+ args = (False, True)
93
+ expected = True
94
+ result = code_to_fuzz.bin_and_bad_generated_function(*args)
95
+ self.assertEqual(result, expected)
96
+
97
+ def test_bin_nand_generated_function_15(self):
98
+ args = (False, False)
99
+ expected = True
100
+ result = code_to_fuzz.bin_nand_generated_function(*args)
101
+ self.assertEqual(result, expected)
102
+
103
+ def test_bin_nand_generated_function_16(self):
104
+ args = (True, True)
105
+ expected = False
106
+ result = code_to_fuzz.bin_nand_generated_function(*args)
107
+ self.assertEqual(result, expected)
108
+
109
+ def test_bin_nand_generated_function_17(self):
110
+ args = (True, False)
111
+ expected = True
112
+ result = code_to_fuzz.bin_nand_generated_function(*args)
113
+ self.assertEqual(result, expected)
114
+
115
+ def test_bin_nand_generated_function_18(self):
116
+ args = (False, True)
117
+ expected = True
118
+ result = code_to_fuzz.bin_nand_generated_function(*args)
119
+ self.assertEqual(result, expected)
120
+
121
+ def test_bin_nor_generated_function_19(self):
122
+ args = (True, True)
123
+ expected = False
124
+ result = code_to_fuzz.bin_nor_generated_function(*args)
125
+ self.assertEqual(result, expected)
126
+
127
+ def test_bin_nor_generated_function_20(self):
128
+ args = (False, True)
129
+ expected = False
130
+ result = code_to_fuzz.bin_nor_generated_function(*args)
131
+ self.assertEqual(result, expected)
132
+
133
+ def test_bin_nor_generated_function_21(self):
134
+ args = (True, False)
135
+ expected = False
136
+ result = code_to_fuzz.bin_nor_generated_function(*args)
137
+ self.assertEqual(result, expected)
138
+
139
+ def test_bin_or_generated_function_22(self):
140
+ args = (False, True)
141
+ expected = True
142
+ result = code_to_fuzz.bin_or_generated_function(*args)
143
+ self.assertEqual(result, expected)
144
+
145
+ def test_bin_or_generated_function_23(self):
146
+ args = (True, False)
147
+ expected = True
148
+ result = code_to_fuzz.bin_or_generated_function(*args)
149
+ self.assertEqual(result, expected)
150
+
151
+ def test_bin_or_generated_function_24(self):
152
+ args = (True, True)
153
+ expected = True
154
+ result = code_to_fuzz.bin_or_generated_function(*args)
155
+ self.assertEqual(result, expected)
156
+
157
+ def test_bin_or_generated_function_25(self):
158
+ args = (False, False)
159
+ expected = False
160
+ result = code_to_fuzz.bin_or_generated_function(*args)
161
+ self.assertEqual(result, expected)
162
+
163
+ def test_bin_or_bad_generated_function_26(self):
164
+ args = (False, True)
165
+ expected = False
166
+ result = code_to_fuzz.bin_or_bad_generated_function(*args)
167
+ self.assertEqual(result, expected)
168
+
169
+ def test_bin_or_bad_generated_function_27(self):
170
+ args = (True, True)
171
+ expected = False
172
+ result = code_to_fuzz.bin_or_bad_generated_function(*args)
173
+ self.assertEqual(result, expected)
174
+
175
+ def test_bin_or_bad_generated_function_28(self):
176
+ args = (False, False)
177
+ expected = True
178
+ result = code_to_fuzz.bin_or_bad_generated_function(*args)
179
+ self.assertEqual(result, expected)
180
+
181
+ def test_bin_or_bad_generated_function_29(self):
182
+ args = (True, False)
183
+ expected = False
184
+ result = code_to_fuzz.bin_or_bad_generated_function(*args)
185
+ self.assertEqual(result, expected)
186
+
187
+ def test_bin_xor_generated_function_30(self):
188
+ args = (True, True)
189
+ expected = False
190
+ result = code_to_fuzz.bin_xor_generated_function(*args)
191
+ self.assertEqual(result, expected)
192
+
193
+ def test_bin_xor_generated_function_31(self):
194
+ args = (True, False)
195
+ expected = True
196
+ result = code_to_fuzz.bin_xor_generated_function(*args)
197
+ self.assertEqual(result, expected)
198
+
199
+ def test_bin_xor_generated_function_32(self):
200
+ args = (False, True)
201
+ expected = True
202
+ result = code_to_fuzz.bin_xor_generated_function(*args)
203
+ self.assertEqual(result, expected)
204
+
205
+ def test_bin_xor_generated_function_33(self):
206
+ args = (False, False)
207
+ expected = False
208
+ result = code_to_fuzz.bin_xor_generated_function(*args)
209
+ self.assertEqual(result, expected)
210
+
211
+ def test_mux_generated_function_34(self):
212
+ args = (True, False, False, True, False, False)
213
+ expected = True
214
+ result = code_to_fuzz.mux_generated_function(*args)
215
+ self.assertEqual(result, expected)
216
+
217
+ def test_mux_generated_function_35(self):
218
+ args = (False, True, False, False, True, False)
219
+ expected = True
220
+ result = code_to_fuzz.mux_generated_function(*args)
221
+ self.assertEqual(result, expected)
222
+
223
+ def test_mux_generated_function_36(self):
224
+ args = (True, False, False, False, True, True)
225
+ expected = False
226
+ result = code_to_fuzz.mux_generated_function(*args)
227
+ self.assertEqual(result, expected)
228
+
229
+ def test_mux_generated_function_37(self):
230
+ args = (False, True, False, True, False, True)
231
+ expected = False
232
+ result = code_to_fuzz.mux_generated_function(*args)
233
+ self.assertEqual(result, expected)
234
+
235
+ def test_mux_generated_function_38(self):
236
+ args = (False, False, True, False, True, False)
237
+ expected = False
238
+ result = code_to_fuzz.mux_generated_function(*args)
239
+ self.assertEqual(result, expected)
240
+
241
+ def test_mux_generated_function_39(self):
242
+ args = (True, False, False, False, False, False)
243
+ expected = False
244
+ result = code_to_fuzz.mux_generated_function(*args)
245
+ self.assertEqual(result, expected)
246
+
247
+ def test_mux_generated_function_40(self):
248
+ args = (False, True, True, True, True, True)
249
+ expected = True
250
+ result = code_to_fuzz.mux_generated_function(*args)
251
+ self.assertEqual(result, expected)
252
+
253
+ def test_mux_generated_function_41(self):
254
+ args = (False, False, False, True, False, False)
255
+ expected = False
256
+ result = code_to_fuzz.mux_generated_function(*args)
257
+ self.assertEqual(result, expected)
258
+
259
+ def test_mux_generated_function_42(self):
260
+ args = (True, False, True, True, True, False)
261
+ expected = True
262
+ result = code_to_fuzz.mux_generated_function(*args)
263
+ self.assertEqual(result, expected)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: testgenie-py
3
- Version: 0.2.9
3
+ Version: 0.3.0
4
4
  Summary: Automated unit test generation tool for Python.
5
5
  Author: cjseitz
6
6
  Author-email: charlesjseitz@gmail.com
@@ -1,3 +1,4 @@
1
+ testgen/.coverage,sha256=Cp0ihR5Imuuiso9j7j71iuvxJfMY6aeVWNHee--RrXA,69632
1
2
  testgen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
3
  testgen/analyzer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
4
  testgen/analyzer/ast_analyzer.py,sha256=fUtrJQsgnKeSKqKaXSO_ZsY_uQr2aPeyTQP9ToyFEg4,6886
@@ -10,12 +11,18 @@ testgen/analyzer/random_feedback_analyzer.py,sha256=hDcNIWE4BFtsoyXHWyxcC1qeq7y9
10
11
  testgen/analyzer/reinforcement_analyzer.py,sha256=U6W7g-xDFS_P0aqxjPRnaXjGp2gOC9TMdfWaetFV7eE,3568
11
12
  testgen/analyzer/test_case_analyzer.py,sha256=0qLcRKOrQ4Uyh1ZMecVTkY9bWjNnx7OridigNyjfUk4,1620
12
13
  testgen/analyzer/test_case_analyzer_context.py,sha256=7umDPHBjoTaCRvZOdNynpnWsr14Gy0E2hpMBPK8mz3Q,2128
14
+ testgen/code_to_test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ testgen/code_to_test/boolean.py,sha256=RM2byJDKFTx1FFrxnPG_uZWb24OcOH20Uh-D1Z-yPcE,3373
16
+ testgen/code_to_test/calculator.py,sha256=j7lw21BYg_vxaQVCrjOlhQOpObjSe5gu9xzthmdGphk,830
17
+ testgen/code_to_test/code_to_fuzz.py,sha256=ZmASYCtvqfW-x70ynjy0o7iA9WLVbvLuf2n2K1fPE9Y,9188
18
+ testgen/code_to_test/code_to_fuzz_lite.py,sha256=EjS4GB5klnJrvZIDDpS9iIt0iZETVJI0ez9DmihMiYc,10429
19
+ testgen/code_to_test/decisions.py,sha256=ZiW-EF1yTOWeQVZ7Xh0oIPHK2NSNPUzVxCY0E2GbYvQ,1376
20
+ testgen/code_to_test/math_utils.py,sha256=FqPQz5-e1oklzGyTVYNO8JMKDg5ob8z05VOlpKfKvvw,853
21
+ testgen/code_to_test/sample_code_bin.py,sha256=kMvV_-oFeAkxUmDx41Pw0iTTmMG1pvX31TezXPWMOkE,4225
13
22
  testgen/controller/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
23
  testgen/controller/cli_controller.py,sha256=A3TsJQT20UI2TlBqC7SyI8TG0n1vP_Itd1K8TRoD3ps,8735
15
24
  testgen/controller/docker_controller.py,sha256=M6Q_tiAGX8j4lH1NLUFMTCreKXmoKTEpgo60z-KWVRg,8343
16
25
  testgen/docker/Dockerfile,sha256=6mutzP0ZkVueuvMLCOy2bsyGxWjLHU-cq7RFkuC8r5Y,781
17
- testgen/generated_boolean.py,sha256=i5at_BZ7YHtveTMYB0JKMFIkBe7cwhCeF5AViLhNoWA,1146
18
- testgen/generated_samplecodebin.py,sha256=pf_aYtcfpjZzgiZ_FiBOxfug_ii3dRX0jnozBgQm7Xw,17030
19
26
  testgen/generator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
27
  testgen/generator/code_generator.py,sha256=-Nh5Jt4my29YWA_LKWn98I4jvDA-fNi6AGuw-vJhRV0,3171
21
28
  testgen/generator/doctest_generator.py,sha256=Dkaf2l72ENk1mqNP3WkOnIY-iqrTHh-443AWtxzRWGY,8806
@@ -43,11 +50,13 @@ testgen/service/analysis_service.py,sha256=uPoPJFLh4Imf5y_Zd8pX9zxRijr-D0K0WV22Y
43
50
  testgen/service/cfg_service.py,sha256=Czr91D5AHVq38yPKyhZDjM5jMObGPvY0yPE-PxNVBYM,2326
44
51
  testgen/service/generator_service.py,sha256=3JCWRlg5UKNhKRG9VXIycDFmuYKsRTzEmhmtlxroWAc,8088
45
52
  testgen/service/logging_service.py,sha256=tCv9LHL1gUScQQp34_iYoUxfCFzLRtFG_DXRsJ73SjA,3189
46
- testgen/service/service.py,sha256=j_tbvale6rIHfBFtJKWT1CYzSRT5tN6muU2RxaQRRRA,20875
53
+ testgen/service/service.py,sha256=tZz6IDsR7FjK53G9In0Bq1RlQtp2SXgcslJJ7Tmhj4I,21220
47
54
  testgen/sqlite/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
55
  testgen/sqlite/db.py,sha256=RUt88ndT4CQRo9aZzLGXPHRK1iw0LyDEGnoWlOLzKGM,2390
49
56
  testgen/sqlite/db_service.py,sha256=F2ug_FBrYOQtJwM2cMkvQrTS54_VhWGDAHXndnTi-c8,9768
50
- testgen/testgen.db,sha256=EQVBRtHL8KcjzXni8Hrg2XwSyXWWt6GXY82NGHklfgE,45056
57
+ testgen/testgen.db,sha256=Q70k6dPV651fhLhlYzN79KlCZD8zJexy7Cn7zGDIKHo,49152
58
+ testgen/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
+ testgen/tests/test_code_to_fuzz.py,sha256=lShIQgyb1qIElcsbUZ8pLLJB6dY1KVAA_Q76Aks6Dvg,8696
51
60
  testgen/tree/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
61
  testgen/tree/node.py,sha256=ONJtbACShN4yNj1X-UslFRgLyBP6mrbg7qZr3c6dWyA,165
53
62
  testgen/tree/tree_utils.py,sha256=gT7jucky6_GWVOlDI6jpv6RMeWCkntGOHIYLvHxD85k,2122
@@ -63,7 +72,7 @@ testgen/util/z3_utils/branch_condition.py,sha256=N9FNR-iJmxIC62NpDQNVZ1OP14rXXqY
63
72
  testgen/util/z3_utils/constraint_extractor.py,sha256=RXJLpmk6dAvHZ27839VXKXNtdy9St1F-17-pSEFu4bM,1285
64
73
  testgen/util/z3_utils/variable_finder.py,sha256=dUh3F9_L_BDMz1ybiGss09LLcM_egbitgj0FT5Nh9u4,245
65
74
  testgen/util/z3_utils/z3_test_case.py,sha256=yF4oJOrXMLzOwDUqXdoeg83MOTl3pvc_lYaZcS01CuQ,4983
66
- testgenie_py-0.2.9.dist-info/METADATA,sha256=x8FM6FoDZMDEwwrMGBT3JN_FXGA2edB4sNl2SQkWjcs,4350
67
- testgenie_py-0.2.9.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
68
- testgenie_py-0.2.9.dist-info/entry_points.txt,sha256=OUN4GqB4zHlHWwWGjwIPbur4E_ZqQgkeeqaCLhzRZgg,47
69
- testgenie_py-0.2.9.dist-info/RECORD,,
75
+ testgenie_py-0.3.0.dist-info/METADATA,sha256=_z3mECZ_M5D3bTWvzG3zE3Qow3GnUP9yyqEIrhaax70,4350
76
+ testgenie_py-0.3.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
77
+ testgenie_py-0.3.0.dist-info/entry_points.txt,sha256=OUN4GqB4zHlHWwWGjwIPbur4E_ZqQgkeeqaCLhzRZgg,47
78
+ testgenie_py-0.3.0.dist-info/RECORD,,
@@ -1,48 +0,0 @@
1
- def bin_and(a: bool, b: bool):
2
- if a == True:
3
- if b == True:
4
- return True
5
- else:
6
- return False
7
- else:
8
- if b == True:
9
- return False
10
- else:
11
- return False
12
-
13
- def bin_xor(a: bool, b: bool):
14
- if a == True:
15
- if b == True:
16
- return False
17
- else:
18
- return True
19
- else:
20
- if b == True:
21
- return True
22
- else:
23
- return False
24
-
25
- def status_flags(active: bool, verified: bool, admin: bool):
26
- if active == True:
27
- if verified == True:
28
- if admin == True:
29
- return 'admin-verified'
30
- else:
31
- return 'user-verified'
32
- else:
33
- if admin == True:
34
- return 'admin-unverified'
35
- else:
36
- return 'user-unverified'
37
- else:
38
- if verified == True:
39
- if admin == True:
40
- return 'admin-verified'
41
- else:
42
- return 'inactive'
43
- else:
44
- if admin == True:
45
- return 'admin-unverified'
46
- else:
47
- return 'inactive'
48
-