testgenie-py 0.1.7__py3-none-any.whl → 0.1.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: testgenie-py
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary:
5
5
  Author: cjseitz
6
6
  Author-email: charlesjseitz@gmail.com
@@ -1,4 +1,3 @@
1
- testgen/.coverage,sha256=LBC31i6ROQvL24jd3a-mAlGfailO1bmEWlrTCTbxC8s,53248
2
1
  testgen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
2
  testgen/analyzer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
3
  testgen/analyzer/ast_analyzer.py,sha256=JmqiosxgZJm2fhNDr5VUBpKKHmf8S2HP9Jm0Xl7NnnI,6783
@@ -11,20 +10,10 @@ testgen/analyzer/random_feedback_analyzer.py,sha256=tQkYwrYCH1xeSU5j1aoh0vUMyZwF
11
10
  testgen/analyzer/reinforcement_analyzer.py,sha256=U6W7g-xDFS_P0aqxjPRnaXjGp2gOC9TMdfWaetFV7eE,3568
12
11
  testgen/analyzer/test_case_analyzer.py,sha256=foHRbz9K6WAn711sXbp-smJHDjI8GTG8F2TpovLZVEo,1530
13
12
  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=cwgRpUdXjTlrUHSHMtA2TAj8Y-ddAn6CaUdXPM4MRmo,4826
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/no_types.py,sha256=kD8CGjVAxVeCjQC45abO773sRNIjiZ4jvhwPRV8-kt0,675
22
- testgen/code_to_test/sample_code_bin.py,sha256=kMvV_-oFeAkxUmDx41Pw0iTTmMG1pvX31TezXPWMOkE,4225
23
13
  testgen/controller/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
14
  testgen/controller/cli_controller.py,sha256=jSwT6Cy3JQhxFPRXaODdZ1md5uXO83Q0IrYh86sIdiE,8832
25
15
  testgen/controller/docker_controller.py,sha256=Jz1Nc7LW-njvCLDk3svPCVz5UDeQ7gAEFLHXrU1Yrws,7237
26
16
  testgen/docker/Dockerfile,sha256=OLaWW4i6uUvVQinzYOmazGDAILyM8czcfl-ENkHLKQw,534
27
- testgen/docker/poetry.lock,sha256=3ZPF2N4KtpMRc9qfamUXumMw7qGmQHaZDaxJ9_bMo7U,51684
28
17
  testgen/docker/pyproject.toml,sha256=JWhMupWM7aQFO7-teR9sfFahKB3aM4NPO8on5P3TRxw,563
29
18
  testgen/generator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
19
  testgen/generator/code_generator.py,sha256=V5Donxz3r3ZW56xyyldJwOuDBaX6e8NOyPc8UzllQs8,2467
@@ -43,7 +32,6 @@ testgen/models/generator_context.py,sha256=V-T9i-3Ar-gdBzQqidyqBb05PTmOu2LtdQdAI
43
32
  testgen/models/test_case.py,sha256=jwodn-6fKHCh4SO2qycbrFyggCb9UlwTZ8k3RdTObDQ,216
44
33
  testgen/presentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
34
  testgen/presentation/cli_view.py,sha256=2fZrsvZ-Wi4j37UvogsK9_yQV5o3A20jowIr6iFRu-s,296
46
- testgen/q_table/global_q_table.json,sha256=xSMRf5ddtLJAogE_RXleAbkmujgAYU3uiblBJmKqc5w,12059
47
35
  testgen/reinforcement/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
36
  testgen/reinforcement/abstract_state.py,sha256=M9Kp8fyJzsTzpyL3ca4HjjYpGXy9DRMw-IG7OgFVisY,154
49
37
  testgen/reinforcement/agent.py,sha256=wvgbi-OVoVJMwhasGgsP2y1TKLiC5qjjTwZBNqKNRns,6098
@@ -74,7 +62,7 @@ testgen/util/z3_utils/branch_condition.py,sha256=N9FNR-iJmxIC62NpDQNVZ1OP14rXXqY
74
62
  testgen/util/z3_utils/constraint_extractor.py,sha256=RXJLpmk6dAvHZ27839VXKXNtdy9St1F-17-pSEFu4bM,1285
75
63
  testgen/util/z3_utils/variable_finder.py,sha256=dUh3F9_L_BDMz1ybiGss09LLcM_egbitgj0FT5Nh9u4,245
76
64
  testgen/util/z3_utils/z3_test_case.py,sha256=yF4oJOrXMLzOwDUqXdoeg83MOTl3pvc_lYaZcS01CuQ,4983
77
- testgenie_py-0.1.7.dist-info/METADATA,sha256=NEqEmswegGYpbG08DuV50BxSw3yvYbXDQJdgujnH5I8,843
78
- testgenie_py-0.1.7.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
79
- testgenie_py-0.1.7.dist-info/entry_points.txt,sha256=OUN4GqB4zHlHWwWGjwIPbur4E_ZqQgkeeqaCLhzRZgg,47
80
- testgenie_py-0.1.7.dist-info/RECORD,,
65
+ testgenie_py-0.1.8.dist-info/METADATA,sha256=Itqh7Z8Ekb-DksDwOcykcfeemKSIWzjvMUZ0rpxUKqA,843
66
+ testgenie_py-0.1.8.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
67
+ testgenie_py-0.1.8.dist-info/entry_points.txt,sha256=OUN4GqB4zHlHWwWGjwIPbur4E_ZqQgkeeqaCLhzRZgg,47
68
+ testgenie_py-0.1.8.dist-info/RECORD,,
testgen/.coverage DELETED
Binary file
File without changes
@@ -1,146 +0,0 @@
1
- from typing import List
2
-
3
-
4
- def bin_and(a: bool, b: bool) ->bool:
5
- """
6
- >>> bin_and(True, False)
7
- False
8
-
9
- >>> bin_and(False, True)
10
- False
11
-
12
- >>> bin_and(False, False)
13
- False
14
-
15
- >>> bin_and(True, True)
16
- True
17
- """
18
- if a == True:
19
- if b == True:
20
- return True
21
- else:
22
- return False
23
- else:
24
- return False
25
-
26
-
27
- def bin_xor(a: bool, b: bool) ->bool:
28
- """
29
- >>> bin_xor(True, True)
30
- False
31
-
32
- >>> bin_xor(True, False)
33
- True
34
-
35
- >>> bin_xor(False, False)
36
- False
37
-
38
- >>> bin_xor(False, True)
39
- True
40
- """
41
- if a == True:
42
- if b == True:
43
- return False
44
- else:
45
- return True
46
- elif b == True:
47
- return True
48
- else:
49
- return False
50
-
51
-
52
- def status_flags(active: bool, verified: bool, admin: bool) ->str:
53
- """
54
- >>> status_flags(False, False, False)
55
- 'inactive'
56
-
57
- >>> status_flags(False, False, True)
58
- 'admin-unverified'
59
-
60
- >>> status_flags(True, True, False)
61
- 'user-verified'
62
-
63
- >>> status_flags(True, True, True)
64
- 'admin-verified'
65
-
66
- >>> status_flags(True, False, False)
67
- 'user-unverified'
68
-
69
- >>> status_flags(False, True, True)
70
- 'admin-verified'
71
-
72
- >>> status_flags(False, True, False)
73
- 'inactive'
74
-
75
- >>> status_flags(True, False, True)
76
- 'admin-unverified'
77
- """
78
- if admin:
79
- if verified:
80
- return 'admin-verified'
81
- else:
82
- return 'admin-unverified'
83
- elif active:
84
- if verified:
85
- return 'user-verified'
86
- else:
87
- return 'user-unverified'
88
- else:
89
- return 'inactive'
90
-
91
-
92
- """def half_adder(a: bool, b: bool) ->tuple:
93
- sum: bool = bin_xor(a, b)
94
- carry: bool = bin_and(a, b)
95
- return sum, carry
96
-
97
-
98
- def full_adder(a: bool, b: bool, carry_in: bool) ->tuple:
99
- sum1, carry = half_adder(a, b)
100
- sum2, carry_out = half_adder(sum1, carry_in)
101
- return sum2, carry or carry_out
102
-
103
-
104
- def thirty_two_bit_adder_excep(x: int, y: int) ->List[int]:
105
- x_bits: List[int] = bit_converter(x)
106
- y_bits: List[int] = bit_converter(y)
107
- result: List[int] = [0] * 32
108
- carry: bool = False
109
- for i in range(32):
110
- try:
111
- sum_bit, carry = full_adder(x_bits[i], y_bits[i], carry)
112
- result[i] = sum_bit
113
- except IndexError as e:
114
- print(f'Index Out of Bounds Error In ThirtyTwoBitAdder: {e}')
115
- result = [1] * 32
116
- if carry:
117
- return OverflowError('Sum exceeds 32 bits')
118
- return result
119
-
120
-
121
- def thirty_two_bit_adder(x: int, y: int) ->List[int]:
122
- print(x.bit_length() - 1)
123
- print(y.bit_length() - 1)
124
- x_bits: List[int] = bit_converter(x)
125
- y_bits: List[int] = bit_converter(y)
126
- result: List[int] = [0] * 32
127
- carry: bool = False
128
- for i in range(32):
129
- sum_bit, carry = full_adder(x_bits[i], y_bits[i], carry)
130
- result[i] = sum_bit
131
- return result
132
-
133
- def bit_converter(num: int) ->List[int]:
134
- binary_str: str = bin(num)[2:]
135
- print(bin(num)[2:])
136
- return [int(digit) for digit in binary_str]
137
-
138
- def thirty_two_bit_adder_excep(x: int, y: int) ->List[int]:
139
- x_bits: List[int] = bit_converter(x)
140
- y_bits: List[int] = bit_converter(y)
141
- result: List[int] = [0] * 32
142
- carry: bool = False
143
- for i in range(32):
144
- sum_bit, carry = full_adder(x_bits[i], y_bits[i], carry)
145
- result[i] = sum_bit
146
- return result"""
@@ -1,29 +0,0 @@
1
- class AdvancedCalculator:
2
-
3
- def evaluate(self, a: int, b: int, op: str) ->(int | float | str):
4
- """>>> AdvancedCalculator().evaluate(16, 56, 'abc')
5
- 'invalid'"""
6
- if op == 'add':
7
- return a + b
8
- elif op == 'sub':
9
- return a - b
10
- elif op == 'mul':
11
- return a * b
12
- elif op == 'div':
13
- if b == 0:
14
- return 'undefined'
15
- return a / b
16
- else:
17
- return 'invalid'
18
-
19
- def is_in_range(self, val: float) ->str:
20
- """>>> AdvancedCalculator().is_in_range(0.4023417704905361)
21
- 'fractional'"""
22
- if val < 0.0:
23
- return 'below zero'
24
- elif 0.0 <= val < 1.0:
25
- return 'fractional'
26
- elif 1.0 <= val <= 100.0:
27
- return 'valid'
28
- else:
29
- return 'out of range'
@@ -1,234 +0,0 @@
1
- from typing import List
2
-
3
-
4
- def bin_and(a: bool, b: bool) ->bool:
5
- """"
6
- >>> bin_and(True, True)
7
- True
8
- >>> bin_and(True, False)
9
- False
10
- >>> bin_and(False, True)
11
- False
12
- >>> bin_and(False, False)
13
- False
14
-
15
- Examples:
16
- >>> bin_and(True, False)
17
- False"""
18
- if a == True:
19
- if b == True:
20
- return True
21
- else:
22
- return False
23
- else:
24
- return False
25
-
26
-
27
- def bin_or(a: bool, b: bool) ->bool:
28
- """"
29
- >>> bin_or(True, True)
30
- True
31
- >>> bin_or(True, False)
32
- True
33
- >>> bin_or(False, True)
34
- True
35
- >>> bin_or(False, False)
36
- False
37
-
38
- Examples:
39
- >>> bin_or(False, True)
40
- True"""
41
- return a | b
42
-
43
-
44
- def bin_xor(a: bool, b: bool) ->bool:
45
- """>>> bin_xor(True, True)
46
- False
47
- >>> bin_xor(True, False)
48
- True
49
- >>> bin_xor(False, True)
50
- True
51
- >>> bin_xor(False, False)
52
- False
53
-
54
- Examples:
55
- >>> bin_xor(True, True)
56
- False"""
57
- return a ^ b
58
-
59
-
60
- def bin_nand(a: bool, b: bool) ->bool:
61
- """>>> bin_nand(True, True)
62
- False
63
- >>> bin_nand(True, False)
64
- True
65
- >>> bin_nand(False, True)
66
- True
67
- >>> bin_nand(False, False)
68
- True
69
-
70
- Examples:
71
- >>> bin_nand(True, False)
72
- True"""
73
- return not (a and b)
74
-
75
-
76
- def bin_nor(a: bool, b: bool) ->bool:
77
- """>>> bin_nor(True, True)
78
- False
79
- >>> bin_nor(True, False)
80
- False
81
- >>> bin_nor(False, True)
82
- False
83
- >>> bin_nor(False, False)
84
- True
85
-
86
- Examples:
87
- >>> bin_nor(False, True)
88
- False"""
89
- return not a | b
90
-
91
-
92
- def mux(c1: bool, c2: bool, x0: bool, x1: bool, x2: bool, x3: bool) ->bool:
93
- """"
94
- >>> mux(1, 1, True, False, False, False)
95
- True
96
- >>> mux(1, 0, False, True, False, False)
97
- True
98
- >>> mux(0, 1, False, False, True, False)
99
- True
100
- >>> mux(0, 0, False, False, False, True)
101
- True
102
- >>> mux(0, 0, False, False, False, False)
103
- False
104
-
105
- Examples:
106
- >>> mux(False, False, False, False, False, True)
107
- True"""
108
- return (c1 and c2 and x0) | (c1 and not c2 and x1) | (not c1 and c2 and x2
109
- ) | (not c1 and not c2 and x3)
110
-
111
-
112
- def bin_and_bad(a: bool, b: bool) ->bool:
113
- """"
114
- >>> bin_and(True, True)
115
- True
116
- >>> bin_and(True, False)
117
- False
118
- >>> bin_and(False, True)
119
- False
120
- >>> bin_and(False, False)
121
- False
122
-
123
- Examples:
124
- >>> bin_and_bad(False, True)
125
- True"""
126
- if a == True and b == True:
127
- return a and b
128
- return a or b
129
-
130
-
131
- def bin_or_bad(a: bool, b: bool) ->bool:
132
- """"
133
- >>> bin_or(True, True)
134
- True
135
- >>> bin_or(True, False)
136
- True
137
- >>> bin_or(False, True)
138
- True
139
- >>> bin_or(False, False)
140
- False
141
-
142
- Examples:
143
- >>> bin_or_bad(True, True)
144
- False"""
145
- return not a | b
146
-
147
-
148
- def bit_converter_excep(num: int) ->List[int]:
149
- """>>> bit_converter_excep(30)
150
- [1, 1, 1, 1, 0]"""
151
- bs = bin(num)
152
- binary_str = bs[2:]
153
- try:
154
- return [int(digit) for digit in binary_str]
155
- except Exception as e:
156
- print(binary_str)
157
- print(bs)
158
- print(f'Invalid Literal Exception in Bit Converter: {e}')
159
- return
160
-
161
-
162
- def bit_converter(num: int) ->List[int]:
163
- """
164
- >>> bit_converter(25)
165
- [1, 1, 0, 0, 1]
166
- """
167
- binary_str: str = bin(num)[2:]
168
- print(bin(num)[2:])
169
- return [int(digit) for digit in binary_str]
170
-
171
-
172
- def half_adder(a: bool, b: bool) ->tuple:
173
- """>>> half_adder(True, True)
174
- (False, True)"""
175
- sum: bool = bin_xor(a, b)
176
- carry: bool = bin_and(a, b)
177
- return sum, carry
178
-
179
-
180
- def full_adder(a: bool, b: bool, carry_in: bool) ->tuple:
181
- """>>> full_adder(True, False, False)
182
- (True, False)"""
183
- sum1, carry = half_adder(a, b)
184
- sum2, carry_out = half_adder(sum1, carry_in)
185
- return sum2, carry or carry_out
186
-
187
-
188
- def thirty_two_bit_adder_excep(x: int, y: int) ->List[int]:
189
- """>>> thirty_two_bit_adder_excep(9, 3)
190
- None
191
-
192
- Examples:
193
- >>> thirty_two_bit_adder_excep(34, 1)
194
- None"""
195
- x_bits: List[int] = bit_converter(x)
196
- y_bits: List[int] = bit_converter(y)
197
- result: List[int] = [0] * 32
198
- carry: bool = False
199
- for i in range(32):
200
- try:
201
- sum_bit, carry = full_adder(x_bits[i], y_bits[i], carry)
202
- result[i] = sum_bit
203
- except IndexError as e:
204
- print(f'Index Out of Bounds Error In ThirtyTwoBitAdder: {e}')
205
- result = [1] * 32
206
- if carry:
207
- return OverflowError('Sum exceeds 32 bits')
208
- return result
209
-
210
-
211
- def thirty_two_bit_adder(x: int, y: int) ->List[int]:
212
- """>>> thirty_two_bit_adder(8, 45)
213
- None"""
214
- print(x.bit_length() - 1)
215
- print(y.bit_length() - 1)
216
- x_bits: List[int] = bit_converter(x)
217
- y_bits: List[int] = bit_converter(y)
218
- result: List[int] = [0] * 32
219
- carry: bool = False
220
- for i in range(32):
221
- sum_bit, carry = full_adder(x_bits[i], y_bits[i], carry)
222
- result[i] = sum_bit
223
- return result
224
-
225
-
226
- def thirty_two_bit_adder_excep(x: int, y: int) ->List[int]:
227
- x_bits: List[int] = bit_converter(x)
228
- y_bits: List[int] = bit_converter(y)
229
- result: List[int] = [0] * 32
230
- carry: bool = False
231
- for i in range(32):
232
- sum_bit, carry = full_adder(x_bits[i], y_bits[i], carry)
233
- result[i] = sum_bit
234
- return result