Пример #1
0
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())
Пример #2
0
 def towers(self):
     return [Tower(path) for path in self.tower_paths()]
Пример #3
0
 def tower(self):
     return Tower(os.path.basename(self.tower_path))
Пример #4
0
 def setUp(self):
     self.tower = Tower('path/to/tower')
Пример #5
0
 def towers(self):
     return map(lambda path: Tower(path), self.tower_paths())