forked from faif/python-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_builder.py
More file actions
28 lines (18 loc) · 758 Bytes
/
Copy pathtest_builder.py
File metadata and controls
28 lines (18 loc) · 758 Bytes
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from creational.builder import construct_building, BuilderHouse, BuilderFlat
class TestHouseBuilding(unittest.TestCase):
def setUp(self):
self.building = construct_building(BuilderHouse())
def test_house_size(self):
self.assertEqual(self.building.size, 'Big')
def test_num_floor_in_house(self):
self.assertEqual(self.building.floor, 'One')
class TestFlatBuilding(unittest.TestCase):
def setUp(self):
self.building = construct_building(BuilderFlat())
def test_house_size(self):
self.assertEqual(self.building.size, 'Small')
def test_num_floor_in_house(self):
self.assertEqual(self.building.floor, 'More than One')