def __init__(self, **kwargs): self.total, _ = account.fs_sizes() self.free = self.total - query.calculate_usage() self.fh = 1 self.nlinks = kwargs.get('nlinks', False) sync_interval = kwargs.get('interval', 0) p = Process(target=_autosync, args=(sync_interval, )) p.start()
def __init__(self, **kwargs): self.total, _ = account.fs_sizes() self.free = self.total - query.calculate_usage() self.fh = 1 self.nlinks = kwargs.get("nlinks", False) sync_interval = kwargs.get("interval", 0) p = Process(target=_autosync, args=(sync_interval,)) p.start()
def testCalculateUsage(self): folders, files = gen_bunch_of_nodes(50) sync.insert_nodes(folders + files) ttlsz = sum(f['contentProperties']['size'] for f in files) self.assertEqual(query.calculate_usage(), ttlsz)
def testCalculateUsageEmpty2(self): sync.insert_node(gen_folder()) self.assertEqual(query.calculate_usage(), 0)
def testCalculateUsageEmpty(self): self.assertEqual(query.calculate_usage(), 0)
def __init__(self): self.total, _ = account.fs_sizes() self.free = self.total - query.calculate_usage() self.fh = 1