-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
31 lines (22 loc) · 910 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import unittest
import HelloWorld
# import Stophur
class TestStringMethods(unittest.TestCase):
def test_helloworld(self):
self.assertEqual(HelloWorld.hello_world(), "Hello, World!")
def test_timesthree(self):
self.assertEqual(HelloWorld.times_three(3), 9)
def test_cubed(self):
self.assertEqual(HelloWorld.cube(3), 27)
def test_square(self):
self.assertEqual(HelloWorld.square(3), 9)
def test_buildtriangle(self):
self.assertEqual(HelloWorld.half_pyramid(5),
["#", "##", "###", "####", "#####"])
def test_findsymbol(self):
self.assertEqual(HelloWorld.find_symbol("BTC/WS"), 332)
self.assertFalse(HelloWorld.find_symbol("Tacos"))
def test_count_char(self):
self.assertEqual(HelloWorld.count_char(";"), 4)
if __name__ == '__main__':
unittest.main()