class TestTower(unittest.TestCase): def setUp(self): self.tower = Tower('path/to/tower') def test_should_consider_last_part_of_path_as_name(self): self.assertEqual(self.tower.name(), 'tower') def test_should_use_name_when_converting_to_string(self): self.assertEqual(str(self.tower), self.tower.name())
def towers(self): return [Tower(path) for path in self.tower_paths()]
def tower(self): return Tower(os.path.basename(self.tower_path))
def setUp(self): self.tower = Tower('path/to/tower')
def towers(self): return map(lambda path: Tower(path), self.tower_paths())