Skip to content

Commit

Permalink
#1007: add test for fluctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed May 8, 2017
1 parent f56f777 commit 65f76c0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions psutil/tests/test_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,16 @@ def test_boot_time(self):
# Wmic time is 2 secs lower for some reason; that's OK.
self.assertLessEqual(diff, 2)

def test_boot_time_fluctuation(self):
with mock('psutil._pswindows.cext.boot_time', return_value=5):
self.assertEqual(psutil.boot_time(), 5)
with mock('psutil._pswindows.cext.boot_time', return_value=4):
self.assertEqual(psutil.boot_time(), 5)
with mock('psutil._pswindows.cext.boot_time', return_value=6):
self.assertEqual(psutil.boot_time(), 5)
with mock('psutil._pswindows.cext.boot_time', return_value=333):
self.assertEqual(psutil.boot_time(), 333)


# ===================================================================
# sensors_battery()
Expand Down

0 comments on commit 65f76c0

Please sign in to comment.