示例#1
0
 def test_boottime_calc(self):
     psi_bt = psi.boottime()
     calc_bt = time.time() - psi.uptime().timestamp()
     calc_min = calc_bt - 2
     calc_max = calc_bt + 2
     self.assert_(calc_min < psi_bt.timestamp() < calc_max,
                  '%s < %s < %s' % (calc_min, psi_bt.timestamp(), calc_max))
示例#2
0
 def test_boottime_calc(self):
     psi_bt = psi.boottime()
     calc_bt = time.time() - psi.uptime().timestamp()
     calc_min = calc_bt - 2
     calc_max = calc_bt + 2
     self.assert_(calc_min < psi_bt.timestamp() < calc_max,
                  '%s < %s < %s' % (calc_min, psi_bt.timestamp(), calc_max))
示例#3
0
 def test_uptime_calc(self):
     psi_uptime = psi.uptime().timestamp()
     calc_uptime = time.time() - psi.boottime().timestamp()
     calc_min = calc_uptime - 2
     calc_max = calc_uptime + 2
     self.assert_(calc_min < psi_uptime < calc_max,
                  "%s < %s < %s" % (calc_min, psi_uptime, calc_max))
示例#4
0
 def test_uptime_calc(self):
     psi_uptime = psi.uptime().timestamp()
     calc_uptime = time.time() - psi.boottime().timestamp()
     calc_min = calc_uptime - 2
     calc_max = calc_uptime + 2
     self.assert_(calc_min < psi_uptime < calc_max,
                  "%s < %s < %s" % (calc_min, psi_uptime, calc_max))
示例#5
0
def check_psi():
    psi.loadavg()
    psi.boottime()
    psi.uptime()
示例#6
0
 def test_lt_now(self):
     bt = psi.boottime()
     now = time.time()
     self.assert_(bt.timestamp() < now, '%s < %s' % (bt.timestamp(), now))
示例#7
0
 def test_gt_epoch(self):
     bt = psi.boottime()
     self.assert_(bt.timestamp() > 0, '%s > 0' % bt.timestamp())
示例#8
0
 def test_timespec(self):
     self.assert_(isinstance(psi.boottime(), psi.TimeSpec))
示例#9
0
 def test_lt_now(self):
     bt = psi.boottime()
     now = time.time()
     self.assert_(bt.timestamp() < now, '%s < %s' % (bt.timestamp(), now))
示例#10
0
 def test_gt_epoch(self):
     bt = psi.boottime()
     self.assert_(bt.timestamp() > 0, '%s > 0' % bt.timestamp())
示例#11
0
 def test_timespec(self):
     self.assert_(isinstance(psi.boottime(), psi.TimeSpec))
示例#12
0
def check_psi():
    psi.loadavg()
    psi.boottime()
    psi.uptime()