Skip to content

Commit 4357a61

Browse files
committed
update samples
1 parent 332b6b0 commit 4357a61

15 files changed

Lines changed: 67 additions & 101 deletions

utbot-python/samples/cli_utbot_tests/generated_tests__arithmetic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
sys.path.append('/home/vyacheslav/Desktop/utbot/UTBotJava/utbot-python/samples/samples')
2+
sys.path.append('samples')
33
import unittest
44
import builtins
55
import arithmetic

utbot-python/samples/cli_utbot_tests/generated_tests__coverage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
sys.path.append('/home/vyacheslav/Desktop/utbot/UTBotJava/utbot-python/samples/samples')
2+
sys.path.append('samples')
33
import unittest
44
import builtins
55
import test_coverage

utbot-python/samples/cli_utbot_tests/generated_tests__deep_equals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
sys.path.append('/home/vyacheslav/Desktop/utbot/UTBotJava/utbot-python/samples/samples')
2+
sys.path.append('samples')
33
import unittest
44
import builtins
55
import deep_equals

utbot-python/samples/cli_utbot_tests/generated_tests__dicts.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
import sys
2-
sys.path.append('/home/vyacheslav/Desktop/utbot/UTBotJava/utbot-python/samples/samples')
2+
sys.path.append('samples')
33
import unittest
44
import builtins
55
import dicts
6+
import copyreg
67
import types
78

89

910
class TestDictionary(unittest.TestCase):
1011
# region Test suites for executable dicts.translate
1112
# region
1213
def test_translate(self):
13-
dictionary = dicts.Dictionary([str(b'\xf0\xa3\x91\x96', 'utf-8'), str(), str(1e+300 * 1e+300), str(b'\x80'), str(1.5 + 3.5j), str(id), str(1e+300 * 1e+300)], [])
14+
dictionary = dicts.Dictionary([str(), str(-123456789), str(b'\x80'), str(1.5 + 3.5j), str(b'\x80'), str(1.5 + 3.5j), str(1e+300 * 1e+300)], [{str(b'\x80'): str(1e+300 * 1e+300), str('unicode remains unicode'): str(), str(1.5 + 3.5j): str(), str(): str()}, {str(): str()}, {}, {str('unicode remains unicode'): str(), str(b'\x80'): str(1e+300 * 1e+300), str(-123456789): str(1e+300 * 1e+300), str(1.5 + 3.5j): str()}, {str('unicode remains unicode'): str()}, {str(): str()}, {str(1.5 + 3.5j): str(), str(-123456789): str(1e+300 * 1e+300), str(1e+300 * 1e+300): str(), str(id): str(), str(b'\x80'): str(1e+300 * 1e+300), str(): str()}])
1415

15-
actual = dictionary.translate(str(id), str(1.5 + 3.5j))
16+
actual = dictionary.translate(str(), str(1.5 + 3.5j))
1617

17-
self.assertEqual(None, actual)
18+
word = copyreg._reconstructor(dicts.Word, builtins.object, None)
19+
word.translations = {"b'\\x80'": 'inf', 'unicode remains unicode': '', '(1.5+3.5j)': '', '': '', }
20+
actual_translations = actual.translations
21+
expected_translations = word.translations
22+
self.assertEqual(expected_translations, actual_translations)
1823

1924
def test_translate_throws_t(self):
20-
dictionary = dicts.Dictionary([], [{str(1.5 + 3.5j): str(), str(-123456789): str(), str(1e+300 * 1e+300): str(), str(b'\x80'): str(), str(id): str(1e+300 * 1e+300)}, {str(b'\x80'): str(1e+300 * 1e+300), str(b'\xf0\xa3\x91\x96', 'utf-8'): str()}, {str(b'\x80'): str(1e+300 * 1e+300), str(b'\xf0\xa3\x91\x96', 'utf-8'): str()}])
25+
dictionary = dicts.Dictionary([str(-1234567890), str(1e+300 * 1e+300), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(1.5 + 3.5j), str(-123456789), str(), str()], [{str(-1234567890): str(), str('unicode remains unicode'): str(), str(-123456789): str(), str(id): str(), str(): str(1e+300 * 1e+300)}, {str(id): str(), str(1e+300 * 1e+300): str(1e+300 * 1e+300), str(): str(), str('unicode remains unicode'): str()}, {str(id): str(), str(1e+300 * 1e+300): str(1e+300 * 1e+300), str(): str(), str('unicode remains unicode'): str()}, {str(): str(), str(-1234567890): str(), str(b'\x80'): str(), str('unicode remains unicode'): str()}, {str(): str()}, {}])
2126

22-
dictionary.translate(str('unicode remains unicode'), str(1.5 + 3.5j))
27+
dictionary.translate(str(-1234567890), str(1.5 + 3.5j))
2328

2429
# raises builtins.KeyError
2530

utbot-python/samples/cli_utbot_tests/generated_tests__graph.py

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
sys.path.append('/home/vyacheslav/Desktop/utbot/UTBotJava/utbot-python/samples/samples')
2+
sys.path.append('samples')
33
import unittest
44
import builtins
55
import graph
@@ -11,69 +11,15 @@ class TestTopLevelFunctions(unittest.TestCase):
1111
# region Test suites for executable graph.bfs
1212
# region
1313
def test_bfs(self):
14-
actual = graph.bfs([graph.Node(str(b'\xf0\xa3\x91\x96', 'utf-8'), [graph.Node(str(-123456789), []), graph.Node(str('unicode remains unicode'), []), graph.Node(str(), []), graph.Node(str(1e+300 * 1e+300), []), graph.Node(str(1.5 + 3.5j), []), graph.Node(str(b'\xf0\xa3\x91\x96', 'utf-8'), [])]), graph.Node(str(-123456789), [graph.Node(str(-1234567890), []), graph.Node(str(), []), graph.Node(str(1e+300 * 1e+300), []), graph.Node(str(-123456789), []), graph.Node(str(-123456789), [])]), graph.Node(str(id), []), graph.Node(str(b'\x80'), [graph.Node(str(-123456789), []), graph.Node(str('unicode remains unicode'), []), graph.Node(str(), []), graph.Node(str(1e+300 * 1e+300), []), graph.Node(str(1.5 + 3.5j), []), graph.Node(str(b'\xf0\xa3\x91\x96', 'utf-8'), [])]), graph.Node(str('unicode remains unicode'), [graph.Node(str(b'\x80'), []), graph.Node(str(b'\x80'), []), graph.Node(str(), []), graph.Node(str('unicode remains unicode'), []), graph.Node(str(1.5 + 3.5j), [])]), graph.Node(str(b'\xf0\xa3\x91\x96', 'utf-8'), [graph.Node(str(-123456789), []), graph.Node(str('unicode remains unicode'), []), graph.Node(str(), []), graph.Node(str(1e+300 * 1e+300), []), graph.Node(str(1.5 + 3.5j), []), graph.Node(str(b'\xf0\xa3\x91\x96', 'utf-8'), [])]), graph.Node(str(id), [graph.Node(str(b'\xf0\xa3\x91\x96', 'utf-8'), []), graph.Node(str(-1234567890), []), graph.Node(str(id), []), graph.Node(str(), []), graph.Node(str(), []), graph.Node(str(-123456789), []), graph.Node(str(), [])]), graph.Node(str(b'\x80'), [graph.Node(str(-1234567890), []), graph.Node(str(), []), graph.Node(str(1e+300 * 1e+300), []), graph.Node(str(-123456789), []), graph.Node(str(-123456789), [])])])
14+
actual = graph.bfs([graph.Node(str(-1234567890), []), graph.Node(str('unicode remains unicode'), [])])
1515

1616
node = copyreg._reconstructor(graph.Node, builtins.object, None)
17+
node.name = 'unicode remains unicode'
18+
node.children = []
1719
node1 = copyreg._reconstructor(graph.Node, builtins.object, None)
1820
node1.name = '-1234567890'
1921
node1.children = []
20-
node2 = copyreg._reconstructor(graph.Node, builtins.object, None)
21-
node2.name = ''
22-
node2.children = []
23-
node3 = copyreg._reconstructor(graph.Node, builtins.object, None)
24-
node3.name = 'inf'
25-
node3.children = []
26-
node4 = copyreg._reconstructor(graph.Node, builtins.object, None)
27-
node4.name = '-123456789'
28-
node4.children = []
29-
node5 = copyreg._reconstructor(graph.Node, builtins.object, None)
30-
node5.name = '-123456789'
31-
node5.children = []
32-
node.name = "b'\\x80'"
33-
node.children = [node1, node2, node3, node4, node5]
34-
node6 = copyreg._reconstructor(graph.Node, builtins.object, None)
35-
node7 = copyreg._reconstructor(graph.Node, builtins.object, None)
36-
node7.name = '𣑖'
37-
node7.children = []
38-
node8 = copyreg._reconstructor(graph.Node, builtins.object, None)
39-
node8.name = '-1234567890'
40-
node8.children = []
41-
node9 = copyreg._reconstructor(graph.Node, builtins.object, None)
42-
node9.name = '<built-in function id>'
43-
node9.children = []
44-
node10 = copyreg._reconstructor(graph.Node, builtins.object, None)
45-
node10.name = ''
46-
node10.children = []
47-
node11 = copyreg._reconstructor(graph.Node, builtins.object, None)
48-
node11.name = ''
49-
node11.children = []
50-
node12 = copyreg._reconstructor(graph.Node, builtins.object, None)
51-
node12.name = '-123456789'
52-
node12.children = []
53-
node13 = copyreg._reconstructor(graph.Node, builtins.object, None)
54-
node13.name = ''
55-
node13.children = []
56-
node6.name = '<built-in function id>'
57-
node6.children = [node7, node8, node9, node10, node11, node12, node13]
58-
node14 = copyreg._reconstructor(graph.Node, builtins.object, None)
59-
node15 = copyreg._reconstructor(graph.Node, builtins.object, None)
60-
node15.name = "b'\\x80'"
61-
node15.children = []
62-
node16 = copyreg._reconstructor(graph.Node, builtins.object, None)
63-
node16.name = "b'\\x80'"
64-
node16.children = []
65-
node17 = copyreg._reconstructor(graph.Node, builtins.object, None)
66-
node17.name = ''
67-
node17.children = []
68-
node18 = copyreg._reconstructor(graph.Node, builtins.object, None)
69-
node18.name = 'unicode remains unicode'
70-
node18.children = []
71-
node19 = copyreg._reconstructor(graph.Node, builtins.object, None)
72-
node19.name = '(1.5+3.5j)'
73-
node19.children = []
74-
node14.name = 'unicode remains unicode'
75-
node14.children = [node15, node16, node17, node18, node19]
76-
self.assertEqual([node, node5, node3, node2, node1, node6, node7, node14, node19], actual)
22+
self.assertEqual([node, node1], actual)
7723

7824
def test_bfs1(self):
7925
actual = graph.bfs([])

utbot-python/samples/cli_utbot_tests/generated_tests__lists.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
sys.path.append('/home/vyacheslav/Desktop/utbot/UTBotJava/utbot-python/samples/samples')
2+
sys.path.append('samples')
33
import unittest
44
import builtins
55
import lists
@@ -10,7 +10,7 @@ class TestTopLevelFunctions(unittest.TestCase):
1010
# region Test suites for executable lists.find_articles_with_author
1111
# region
1212
def test_find_articles_with_author(self):
13-
actual = lists.find_articles_with_author([lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(), datetime.datetime(2014, 11, 2, 1, 30)), lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(b'\xf0\xa3\x91\x96', 'utf-8'), datetime.datetime(2015, 4, 5, 1, 45)), lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(), datetime.datetime(1, 2, 3, 4, 5, 6, 7)), lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(1e+300 * 1e+300), datetime.datetime(2015, 4, 5, 1, 45)), lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(-123456789), datetime.datetime(2011, 1, 1)), lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str('unicode remains unicode'), datetime.datetime(2015, 4, 5, 1, 45))], str('unicode remains unicode'))
13+
actual = lists.find_articles_with_author([lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(b'\x80'), datetime.datetime(2014, 11, 2, 1, 30)), lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(id), datetime.datetime(1, 1, 1)), lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(b'\x80'), datetime.datetime(2014, 11, 2, 1, 30)), lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(b'\x80'), datetime.datetime(2014, 11, 2, 1, 30)), lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(-1234567890), datetime.datetime(1, 2, 3, 4, 5, 6, 7)), lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(-123456789), datetime.datetime(2011, 1, 1)), lists.Article(str(-123456789), str(b'\xf0\xa3\x91\x96', 'utf-8'), str(), datetime.datetime(2014, 11, 2, 1, 30))], str('unicode remains unicode'))
1414

1515
self.assertEqual([], actual)
1616

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
import sys
2-
sys.path.append('/home/vyacheslav/Desktop/utbot/UTBotJava/utbot-python/samples/samples')
2+
sys.path.append('samples')
33
import unittest
44
import builtins
55
import longest_subsequence
66

77

88
class TestTopLevelFunctions(unittest.TestCase):
9-
# region Test suites for executable samples.longest_subsequence.longest_subsequence
9+
# region Test suites for executable longest_subsequence.longest_subsequence
1010
# region
1111
def test_longest_subsequence(self):
12-
actual = longest_subsequence.longest_subsequence([4294967296, -3, -3, 4294967297, 0, -3, 83, -1, 1, 1, 1, 1])
13-
14-
self.assertEqual([-3, -3, 0, 1, 1, 1, 1], actual)
15-
16-
def test_longest_subsequence1(self):
17-
actual = longest_subsequence.longest_subsequence([83, (1 << 100)])
18-
19-
self.assertEqual([83, 1267650600228229401496703205376], actual)
20-
12+
actual = longest_subsequence.longest_subsequence([1, 0, 83, 1, 1])
13+
14+
self.assertEqual([0, 1, 1], actual)
15+
2116
# endregion
22-
17+
2318
# endregion
19+
2420

utbot-python/samples/cli_utbot_tests/generated_tests__matrix.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
sys.path.append('/home/vyacheslav/Desktop/utbot/UTBotJava/utbot-python/samples/samples')
2+
sys.path.append('samples')
33
import unittest
44
import matrix
55
import builtins
@@ -11,14 +11,14 @@ class TestMatrix(unittest.TestCase):
1111
# region Test suites for executable matrix.__add__
1212
# region
1313
def test__add__(self):
14-
matrix1 = matrix.Matrix([[7.3, 7.3, float(1970), float(1970), 0.0, float(1970), float(10 ** 23)], [float(10 ** 23), float(1970), float(10 ** 23), float(-1), float(1970)], [7.3, 7.3, float(1970), float(1970), 0.0, float(1970), float(10 ** 23)], [7.3, 7.3, float(1970), float(1970), 0.0, float(1970), float(10 ** 23)], [float('1.4')], []])
15-
self1 = matrix.Matrix([[7.3, 7.3, float(1970), float(1970), 0.0, float(1970), float(10 ** 23)], [float(10 ** 23), float(1970), float(10 ** 23), float(-1), float(1970)], [7.3, 7.3, float(1970), float(1970), 0.0, float(1970), float(10 ** 23)], [7.3, 7.3, float(1970), float(1970), 0.0, float(1970), float(10 ** 23)], [float('1.4')], []])
14+
matrix1 = matrix.Matrix([[7.3, float(314), 7.3, 7.3, 0.0, 7.3], [float(10 ** 23)], [float('1.4')], [float(-1), float(10 ** 23), float(-1), float('nan'), 7.3], [float(-1), float('+infinity'), float(10 ** 23), float(-1), 0.0], [float(314), float('+infinity'), float(-1), float('nan'), float(10 ** 23)], [float(10 ** 23)]])
15+
self1 = matrix.Matrix([[7.3, float(314), 7.3, 7.3, 0.0, 7.3], [float(10 ** 23)], [float('1.4')], [float(-1), float(10 ** 23), float(-1), float('nan'), 7.3], [float(-1), float('+infinity'), float(10 ** 23), float(-1), 0.0], [float(314), float('+infinity'), float(-1), float('nan'), float(10 ** 23)], [float(10 ** 23)]])
1616

1717
actual = matrix1.__add__(self1)
1818

1919
matrix2 = copyreg._reconstructor(matrix.Matrix, builtins.object, None)
20-
matrix2.elements = [[14.6, 14.6, 3940.0, 3940.0, 0.0, 3940.0, 2e+23], [2e+23, 3940.0, 2e+23, -2.0, 3940.0], [14.6, 14.6, 3940.0, 3940.0, 0.0, 3940.0, 2e+23], [14.6, 14.6, 3940.0, 3940.0, 0.0, 3940.0, 2e+23], [2.8], []]
21-
matrix2.dim = (6, 7)
20+
matrix2.elements = [[14.6, 628.0, 14.6, 14.6, 0.0, 14.6], [2e+23], [2.8], [-2.0, 2e+23, -2.0, float('nan'), 14.6], [-2.0, float('inf'), 2e+23, -2.0, 0.0], [628.0, float('inf'), -2.0, float('nan'), 2e+23], [2e+23]]
21+
matrix2.dim = (7, 6)
2222
self.assertEqual(matrix2, actual)
2323

2424
# endregion
@@ -39,7 +39,7 @@ def test__mul__(self):
3939

4040
def test__mul__throws_t(self):
4141
matrix1 = matrix.Matrix([])
42-
self1 = matrix.Matrix([[float('nan')], [float(1970), float(10 ** 23), float('1.4'), 0.0, 7.3, float(1970)], [0.0, float('nan'), float(1970), float(-1), float('+infinity'), float(-1)], [float('+infinity'), float(1970), float('1.4'), float(1970)], [float(1970), float(1970), 7.3, 0.0, float(10 ** 23), float('1.4')]])
42+
self1 = matrix.Matrix([[0.0, float('nan'), float('+infinity'), float(-1), float('1.4'), float('+infinity')]])
4343

4444
matrix1.__mul__(self1)
4545

utbot-python/samples/cli_utbot_tests/generated_tests__primitive_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
sys.path.append('/home/vyacheslav/Desktop/utbot/UTBotJava/utbot-python/samples/samples')
2+
sys.path.append('samples')
33
import unittest
44
import builtins
55
import primitive_types

utbot-python/samples/cli_utbot_tests/generated_tests__quick_sort.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
sys.path.append('/home/vyacheslav/Desktop/utbot/UTBotJava/utbot-python/samples/samples')
2+
sys.path.append('samples')
33
import unittest
44
import builtins
55
import quick_sort
@@ -9,14 +9,14 @@ class TestTopLevelFunctions(unittest.TestCase):
99
# region Test suites for executable quick_sort.quick_sort
1010
# region
1111
def test_quick_sort(self):
12-
actual = quick_sort.quick_sort([4294967296])
12+
actual = quick_sort.quick_sort([83, -3, -3, 1])
1313

14-
self.assertEqual([4294967296], actual)
14+
self.assertEqual([-3, -3, 1, 83], actual)
1515

1616
def test_quick_sort1(self):
17-
actual = quick_sort.quick_sort([-1, 4294967297, 123, 4294967296, 4294967296, -3])
17+
actual = quick_sort.quick_sort([1, 1])
1818

19-
self.assertEqual([-3, -1, 123, 4294967296, 4294967296, 4294967297], actual)
19+
self.assertEqual([1, 1], actual)
2020

2121
def test_quick_sort2(self):
2222
actual = quick_sort.quick_sort([])

0 commit comments

Comments
 (0)