File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
demo-assignments/A0-OOP/hello/tests Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change 1212import unittest
1313from unittest .mock import patch
1414from io import StringIO
15- from hello import HelloWorld
15+ from helloworld import HelloWorld
1616
1717
1818class TestHelloWorld (unittest .TestCase ):
@@ -21,27 +21,18 @@ class TestHelloWorld(unittest.TestCase):
2121 """
2222
2323 def setUp (self ) -> None :
24- """
25- Setup method
26- :return: None
24+ """Setup method
2725 """
2826 self .hello = HelloWorld ()
2927
3028 @patch ('sys.stdout' , new_callable = StringIO )
3129 def test_print_message (self , mock_stdout : StringIO ) -> None :
32- """
33- Tests printMessage method
34- :return: None
30+ """Tests printMessage method
3531 """
3632 self .hello .print_message ()
3733 self .assertEqual (mock_stdout .getvalue (), 'Hello World!\n ' )
3834
39- def test_getMessage (self ) -> None :
40- """
41- Tests getMessage method
42- :return: None
43- """
44- self .assertEqual (self .hello .get_message (), 'Hello World!' )
45-
4635 def test_message (self ) -> None :
36+ """Test message property
37+ """
4738 self .assertEqual (self .hello .message , 'Hello World!' )
You can’t perform that action at this time.
0 commit comments