Example #1
0
    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()
Example #2
0
    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()
Example #3
0
 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)
Example #4
0
 def testCalculateUsageEmpty2(self):
     sync.insert_node(gen_folder())
     self.assertEqual(query.calculate_usage(), 0)
Example #5
0
 def testCalculateUsageEmpty(self):
     self.assertEqual(query.calculate_usage(), 0)
Example #6
0
 def __init__(self):
     self.total, _ = account.fs_sizes()
     self.free = self.total - query.calculate_usage()
     self.fh = 1