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 f541829

Browse files
more exercises but without unit testing
1 parent ab37d63 commit f541829

File tree

68 files changed

+478
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+478
-1
lines changed

‎.gitpod.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ FROM gitpod/workspace-full:latest
44

55
USER gitpod
66

7-
RUN pip3 install pytest==4.4.2 pytest-testdox mock && npm i breathecode-cli@1.2.5 -g
7+
RUN pip3 install pytest==4.4.2 pytest-testdox mock && npm i breathecode-cli@1.2.52 -g

‎exercises/07.1-square-value/README.md

Lines changed: 8 additions & 0 deletions

‎exercises/07.1-square-value/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# your code here

‎exercises/07.1-square-value/solution.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def square(num):
2+
return num ** 2
3+
4+
print square(2)
5+
print square(3)

‎exercises/07.1-square-value/test.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import io, sys, pytest, os, re, mock
2+
3+
@pytest.mark.it('The function square must exist')
4+
def test_for_functon_existence(capsys, app):
5+
assert callable(app.square)
6+
7+
@pytest.mark.it('The we tried 6 and it should return 36')
8+
def test_for_file_output(capsys, app):
9+
assert app.square(6) == 6*6
10+
11+
@pytest.mark.it('The we tried 47 and it should return 2209')
12+
def test_for_file_output(capsys, app):
13+
assert app.square(47) == 47*47
14+
15+
@pytest.mark.it("Use the ** operator")
16+
def test_operator():
17+
path = os.path.dirname(os.path.abspath(__file__))+'/app.py'
18+
with open(path, 'r') as content_file:
19+
content = content_file.read()
20+
regex = re.compile(r"\*\*")
21+
assert bool(regex.search(content)) == True
22+
23+

‎exercises/21-factorial/README.md

Lines changed: 11 additions & 0 deletions

‎exercises/21-factorial/app.py

Whitespace-only changes.

‎exercises/21-factorial/solution.hide.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def fact(x):
2+
if x == 0:
3+
return 1
4+
return x * fact(x - 1)
5+
6+
x=int(raw_input())
7+
print fact(x)

‎exercises/22-Integral/README.md

Lines changed: 11 additions & 0 deletions

‎exercises/22-Integral/app.py

Whitespace-only changes.

0 commit comments

Comments
(0)

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