Beispiel #1
0
 def test_account_stat_get_data(self):
     stat = db_stats_collector.AccountStatsCollector(self.conf)
     account_db = AccountBroker("%s/acc.db" % self.accounts,
                                account='test_acc')
     account_db.initialize()
     account_db.put_container('test_container', time.time(), None, 10, 1000)
     info = stat.get_data("%s/acc.db" % self.accounts)
     self.assertEquals('''"test_acc",1,10,1000\n''', info)
 def test_account_stat_get_data(self):
     stat = db_stats_collector.AccountStatsCollector(self.conf)
     account_db = AccountBroker("%s/acc.db" % self.accounts,
                                     account='test_acc')
     account_db.initialize()
     account_db.put_container('test_container', time.time(),
                                   None, 10, 1000)
     info = stat.get_data("%s/acc.db" % self.accounts)
     self.assertEquals('''"test_acc",1,10,1000\n''', info)
    def _gen_account_stat(self):
        stat = db_stats_collector.AccountStatsCollector(self.conf)
        output_data = set()
        for i in range(10):
            account_db = AccountBroker("%s/stats-201001010%s-%s.db" %
                                       (self.accounts, i, uuid.uuid4().hex),
                                        account='test_acc_%s' % i)
            account_db.initialize()
            account_db.put_container('test_container', time.time(),
                                      None, 10, 1000)
            # this will "commit" the data
            account_db.get_info()
            output_data.add('''"test_acc_%s",1,10,1000''' % i),

        self.assertEqual(len(output_data), 10)
        return stat, output_data
Beispiel #4
0
    def _gen_account_stat(self):
        stat = db_stats_collector.AccountStatsCollector(self.conf)
        output_data = set()
        for i in range(10):
            account_db = AccountBroker("%s/stats-201001010%s-%s.db" %
                                       (self.accounts, i, uuid.uuid4().hex),
                                       account='test_acc_%s' % i)
            account_db.initialize()
            account_db.put_container('test_container', time.time(), None, 10,
                                     1000)
            # this will "commit" the data
            account_db.get_info()
            output_data.add('''"test_acc_%s",1,10,1000''' % i),

        self.assertEqual(len(output_data), 10)
        return stat, output_data