def required_free_space(self): spaces = { self.config.openstack['puppets']['dst']: glob.glob(self.config.openstack['puppets']['src']), } for dst, srcs in six.iteritems(spaces): size = 0 for src in srcs: size += utils.dir_size(src) spaces[dst] = size return spaces
def test_dir_size(self, _, __, ___): path = '/path/dir' self.assertEqual(utils.dir_size(path), 2)