-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add boilerplate (empty) code for remaining lessons
- Loading branch information
Ignacio Avas
committed
May 2, 2017
1 parent
bf1a5b9
commit 9e8a253
Showing
34 changed files
with
645 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Boilerplate | ||
----------- | ||
|
||
Insertar alguna introducción aquí. | ||
|
||
.. sourcecode:: python | ||
|
||
print('Some python code here') | ||
|
||
|
||
Desafío | ||
------- | ||
|
||
Describir el desafío aquí. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Boilerplate | ||
----------- | ||
|
||
Insert some introduction here. | ||
|
||
.. sourcecode:: python | ||
|
||
print('Some python code here') | ||
|
||
|
||
Challenge | ||
--------- | ||
|
||
Describe the challenge here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.. sourcecode:: python | ||
|
||
print('Some solution here') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"""" | ||
Classes Adventure | ||
Author: Ignacio Avas ([email protected]) | ||
""" | ||
import codecs | ||
import io | ||
import sys | ||
import unittest | ||
from story.adventures import AdventureVerificationError, BaseAdventure | ||
from story.translation import gettext as _ | ||
|
||
|
||
class TestOutput(unittest.TestCase): | ||
"""Adventure test""" | ||
|
||
def __init__(self, candidate_code, file_name='<inline>'): | ||
"""Init the test""" | ||
super(TestOutput, self).__init__() | ||
self.candidate_code = candidate_code | ||
self.file_name = file_name | ||
|
||
def setUp(self): | ||
self.__old_stdout = sys.stdout | ||
sys.stdout = self.__mockstdout = io.StringIO() | ||
|
||
def tearDown(self): | ||
sys.stdout = self.__old_stdout | ||
self.__mockstdout.close() | ||
|
||
def runTest(self): | ||
"""Makes a simple test of the output""" | ||
|
||
#code = compile(self.candidate_code, self.file_name, 'exec', optimize=0) | ||
#exec(code) | ||
self.fail("Test not implemented") | ||
|
||
|
||
class Adventure(BaseAdventure): | ||
"""Classes Adventure""" | ||
title = _('Classes') | ||
|
||
@classmethod | ||
def test(cls, sourcefile): | ||
"""Test against the provided file""" | ||
suite = unittest.TestSuite() | ||
raw_program = codecs.open(sourcefile).read() | ||
suite.addTest(TestOutput(raw_program, sourcefile)) | ||
result = unittest.TextTestRunner().run(suite) | ||
if not result.wasSuccessful(): | ||
raise AdventureVerificationError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Boilerplate | ||
----------- | ||
|
||
Insertar alguna introducción aquí. | ||
|
||
.. sourcecode:: python | ||
|
||
print('Some python code here') | ||
|
||
|
||
Desafío | ||
------- | ||
|
||
Describir el desafío aquí. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Boilerplate | ||
----------- | ||
|
||
Insert some introduction here. | ||
|
||
.. sourcecode:: python | ||
|
||
print('Some python code here') | ||
|
||
|
||
Challenge | ||
--------- | ||
|
||
Describe the challenge here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.. sourcecode:: python | ||
|
||
print('Some solution here') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"""" | ||
Conditions Adventure | ||
Author: Ignacio Avas ([email protected]) | ||
""" | ||
import codecs | ||
import io | ||
import sys | ||
import unittest | ||
from story.adventures import AdventureVerificationError, BaseAdventure | ||
from story.translation import gettext as _ | ||
|
||
|
||
class TestOutput(unittest.TestCase): | ||
"""Adventure test""" | ||
|
||
def __init__(self, candidate_code, file_name='<inline>'): | ||
"""Init the test""" | ||
super(TestOutput, self).__init__() | ||
self.candidate_code = candidate_code | ||
self.file_name = file_name | ||
|
||
def setUp(self): | ||
self.__old_stdout = sys.stdout | ||
sys.stdout = self.__mockstdout = io.StringIO() | ||
|
||
def tearDown(self): | ||
sys.stdout = self.__old_stdout | ||
self.__mockstdout.close() | ||
|
||
def runTest(self): | ||
"""Makes a simple test of the output""" | ||
|
||
#code = compile(self.candidate_code, self.file_name, 'exec', optimize=0) | ||
#exec(code) | ||
self.fail("Test not implemented") | ||
|
||
|
||
class Adventure(BaseAdventure): | ||
"""Conditions Adventure""" | ||
title = _('Conditions') | ||
|
||
@classmethod | ||
def test(cls, sourcefile): | ||
"""Test against the provided file""" | ||
suite = unittest.TestSuite() | ||
raw_program = codecs.open(sourcefile).read() | ||
suite.addTest(TestOutput(raw_program, sourcefile)) | ||
result = unittest.TextTestRunner().run(suite) | ||
if not result.wasSuccessful(): | ||
raise AdventureVerificationError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Boilerplate | ||
----------- | ||
|
||
Insertar alguna introducción aquí. | ||
|
||
.. sourcecode:: python | ||
|
||
print('Some python code here') | ||
|
||
|
||
Desafío | ||
------- | ||
|
||
Describir el desafío aquí. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Boilerplate | ||
----------- | ||
|
||
Insert some introduction here. | ||
|
||
.. sourcecode:: python | ||
|
||
print('Some python code here') | ||
|
||
|
||
Challenge | ||
--------- | ||
|
||
Describe the challenge here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.. sourcecode:: python | ||
|
||
print('Some solution here') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"""" | ||
Boilerplate Adventure | ||
Author: Ignacio Avas ([email protected]) | ||
""" | ||
import codecs | ||
import io | ||
import sys | ||
import unittest | ||
from story.adventures import AdventureVerificationError, BaseAdventure | ||
from story.translation import gettext as _ | ||
|
||
|
||
class TestOutput(unittest.TestCase): | ||
"""Adventure test""" | ||
|
||
def __init__(self, candidate_code, file_name='<inline>'): | ||
"""Init the test""" | ||
super(TestOutput, self).__init__() | ||
self.candidate_code = candidate_code | ||
self.file_name = file_name | ||
|
||
def setUp(self): | ||
self.__old_stdout = sys.stdout | ||
sys.stdout = self.__mockstdout = io.StringIO() | ||
|
||
def tearDown(self): | ||
sys.stdout = self.__old_stdout | ||
self.__mockstdout.close() | ||
|
||
def runTest(self): | ||
"""Makes a simple test of the output""" | ||
|
||
#code = compile(self.candidate_code, self.file_name, 'exec', optimize=0) | ||
#exec(code) | ||
self.fail("Test not implemented") | ||
|
||
|
||
class Adventure(BaseAdventure): | ||
"""Dictionary Adventure""" | ||
title = _('Dictionaries') | ||
|
||
@classmethod | ||
def test(cls, sourcefile): | ||
"""Test against the provided file""" | ||
suite = unittest.TestSuite() | ||
raw_program = codecs.open(sourcefile).read() | ||
suite.addTest(TestOutput(raw_program, sourcefile)) | ||
result = unittest.TextTestRunner().run(suite) | ||
if not result.wasSuccessful(): | ||
raise AdventureVerificationError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
"""" | ||
Boilerplate Adventure | ||
Formatting Adventure | ||
Author: Ignacio Avas ([email protected]) | ||
""" | ||
|
@@ -52,7 +52,7 @@ def runTest(self): | |
|
||
|
||
class Adventure(BaseAdventure): | ||
"""Boilerplate Adventure""" | ||
"""Formatting Adventure""" | ||
title = _('String Formatting') | ||
|
||
@classmethod | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Boilerplate | ||
----------- | ||
|
||
Insertar alguna introducción aquí. | ||
|
||
.. sourcecode:: python | ||
|
||
print('Some python code here') | ||
|
||
|
||
Desafío | ||
------- | ||
|
||
Describir el desafío aquí. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Boilerplate | ||
----------- | ||
|
||
Insert some introduction here. | ||
|
||
.. sourcecode:: python | ||
|
||
print('Some python code here') | ||
|
||
|
||
Challenge | ||
--------- | ||
|
||
Describe the challenge here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.. sourcecode:: python | ||
|
||
print('Some solution here') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
"""" | ||
Functions Adventure | ||
Author: Ignacio Avas ([email protected]) | ||
""" | ||
import codecs | ||
import io | ||
import sys | ||
import unittest | ||
from story.adventures import AdventureVerificationError, BaseAdventure | ||
from story.translation import gettext as _ | ||
|
||
|
||
class TestOutput(unittest.TestCase): | ||
"""Adventure test""" | ||
|
||
def __init__(self, candidate_code, file_name='<inline>'): | ||
"""Init the test""" | ||
super(TestOutput, self).__init__() | ||
self.candidate_code = candidate_code | ||
self.file_name = file_name | ||
|
||
def setUp(self): | ||
self.__old_stdout = sys.stdout | ||
sys.stdout = self.__mockstdout = io.StringIO() | ||
|
||
def tearDown(self): | ||
sys.stdout = self.__old_stdout | ||
self.__mockstdout.close() | ||
|
||
def runTest(self): | ||
"""Makes a simple test of the output""" | ||
|
||
#code = compile(self.candidate_code, self.file_name, 'exec', optimize=0) | ||
#exec(code) | ||
self.fail("Test not implemented") | ||
|
||
|
||
class Adventure(BaseAdventure): | ||
"""Functions Adventure""" | ||
|
||
title = _('Functions') | ||
|
||
@classmethod | ||
def test(cls, sourcefile): | ||
"""Test against the provided file""" | ||
suite = unittest.TestSuite() | ||
raw_program = codecs.open(sourcefile).read() | ||
suite.addTest(TestOutput(raw_program, sourcefile)) | ||
result = unittest.TextTestRunner().run(suite) | ||
if not result.wasSuccessful(): | ||
raise AdventureVerificationError() |
Oops, something went wrong.