Skip to content

Commit 3244157

Browse files
authored
Update test.py
1 parent e8c667b commit 3244157

File tree

1 file changed

+12
-5
lines changed
  • exercises/38-sort-tuples-ascending

1 file changed

+12
-5
lines changed

exercises/38-sort-tuples-ascending/test.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@
22

33
path = os.path.dirname(os.path.abspath(__file__))+'/app.py'
44

5-
65
@pytest.mark.it('The function sort_tuples_ascending must exist')
76
def test_function_existence(capsys, app):
87
assert app.sort_tuples_ascending
98

10-
119
@pytest.mark.it('The function should return the expected output')
12-
def etest_expected_output(capsys, app):
13-
app.sort_tuples_ascending("Tom,19,80 John,20,90 Jony,17,91 Jony,17,93 Json,21,85") == [('John', '20', '90'), ('Jony', '17', '91'), ('Jony', '17', '93'), ('Json', '21', '85'), ('Tom', '19', '80')]
10+
def test_expected_output(capsys, app):
11+
assert app.sort_tuples_ascending([
12+
'Tom,19,80',
13+
'John,20,90',
14+
'Jony,17,91',
15+
'Jony,17,93',
16+
'Jason,21,85'
17+
]) == [('Jason', '21', '85'), ('John', '20', '90'), ('Jony', '17', '91'), ('Jony', '17', '93'), ('Tom', '19', '80')]
1418

1519
@pytest.mark.it('The solution should work with other entries')
1620
def test_another_entry(capsys, app):
17-
app.sort_tuples_ascending("Martin,23,30 Tomas,25,27") == [('Martin', '23', '30'), ('Tomas', '25', '27')]
21+
assert app.sort_tuples_ascending([
22+
'Martin,23,30',
23+
'Tomas,25,27'
24+
]) == [('Martin', '23', '30'), ('Tomas', '25', '27')]

0 commit comments

Comments
 (0)