Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 327050d

Browse files
Merge pull request #64 from tommygonzaleza/15.2-Parking_lot_check
Issue #376 fixed
2 parents 6caec3e + e83bd4d commit 327050d

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

‎exercises/15.2-Parking_lot_check/README.es.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Podemos usar una lista bidimensional (matriz) para representar el estado actual de un estacionamiento:
44

55
![Parking lot](https://storage.googleapis.com/replit/images/1558366147943_71c41e2a3f01564b5bdba6618797af79.pn)
6+
67
```py
78

89
parking_state = [

‎exercises/15.2-Parking_lot_check/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ parking_state = [
2020
1. Create a function get_parking_lot() that returns a dictionary with `total_slots`, `available_slots` and `occupied_slots` like the following:
2121

2222
```python
23+
2324
state = {
2425
total_slots: 12,
2526
available_slots: 3,
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
import io, sys, pytest, os, re
22
path = os.path.dirname(os.path.abspath(__file__))+'/app.py'
33

4-
@pytest.mark.it("Print the updated state ")
5-
def test_output(capsys, app):
6-
import app
7-
captured = capsys.readouterr()
8-
assert "{'total_slots': 6, 'available_slots': 1, 'occupied_slots': 5}\n" in captured.out
9-
10-
114
@pytest.mark.it("Create the function get_parking_lot")
125
def test_variable_exists(app):
136
try:
147
app.get_parking_lot
158
except AttributeError:
169
raise AttributeError("The function get_parking_lot should exist on app.py")
1710

18-
19-
20-
21-
22-
23-
11+
@pytest.mark.it('The function get_parking_lot should return an object with correct values')
12+
def test_variable_exists(app):
13+
value1 = [[1,1,1], [0,0,0], [1,1,2]]
14+
result1 = {'total_slots': 9, 'available_slots': 1, 'occupied_slots': 5}
15+
try:
16+
assert app.get_parking_lot(value1) == result1
17+
except AttributeError:
18+
raise AttributeError("The function get_parking_lot should exist on app.py")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /