mirror of
https://github.com/jlengrand/jlengrand.github.io.git
synced 2026-03-10 08:31:22 +00:00
Removes some of the strange html characters
This commit is contained in:
@@ -56,13 +56,13 @@ Let's say I want to create a (dum) function calculating the square value of a
|
||||
</ul>
|
||||
[python]
|
||||
def square_value(a):
|
||||
"""
|
||||
"""
|
||||
Returns the square value of a.
|
||||
"""
|
||||
"""
|
||||
try:
|
||||
out = a*a
|
||||
except TypeError:
|
||||
raise TypeError("Input should be a string:")
|
||||
raise TypeError("Input should be a string:")
|
||||
|
||||
return out
|
||||
[/python]
|
||||
@@ -73,19 +73,19 @@ def square_value(a):
|
||||
import dum_function as df # import function module
|
||||
import unittest
|
||||
class Test(unittest.TestCase):
|
||||
"""
|
||||
"""
|
||||
The class inherits from unittest
|
||||
"""
|
||||
"""
|
||||
def setUp(self):
|
||||
"""
|
||||
"""
|
||||
This method is called before each test
|
||||
"""
|
||||
self.false_int = "A"
|
||||
"""
|
||||
self.false_int = "A"
|
||||
|
||||
def tearDown(self):
|
||||
"""
|
||||
"""
|
||||
This method is called after each test
|
||||
"""
|
||||
"""
|
||||
pass
|
||||
#---
|
||||
## TESTS
|
||||
@@ -93,7 +93,7 @@ class Test(unittest.TestCase):
|
||||
# assertRaises(excClass, callableObj) prototype
|
||||
self.assertRaises(TypeError, df.square_value(self.false_int))
|
||||
|
||||
if __name__ == "__main__":
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
[/python]
|
||||
<ul>
|
||||
@@ -104,10 +104,10 @@ if __name__ == "__main__":
|
||||
ERROR: test_square_value (__main__.Test)
|
||||
----------------------------------------------------------------------
|
||||
Traceback (most recent call last):
|
||||
File "test_dum_function.py", line 22, in test_square_value
|
||||
File "test_dum_function.py", line 22, in test_square_value
|
||||
self.assertRaises(TypeError, df.square_value(self.false_int))
|
||||
File "/home/jlengrand/Desktop/function.py", line 8, in square_value
|
||||
raise TypeError("Input should be a string:")
|
||||
File "/home/jlengrand/Desktop/function.py", line 8, in square_value
|
||||
raise TypeError("Input should be a string:")
|
||||
TypeError: Input should be a string:
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user