diff options
| author | Damian Johnson <atagar@torproject.org> | 2017-08-20 10:54:21 -0700 |
|---|---|---|
| committer | Damian Johnson <atagar@torproject.org> | 2017-08-20 10:56:37 -0700 |
| commit | 3fb2faa5a295d22f08bb7aeb1d41aab46d87e564 (patch) | |
| tree | 172202e6c2984aae8467d94e2d6152356f4fa803 | |
| parent | 75f883864d9b68b11f8f2d1611a449c5ca9db063 (diff) | |
Ensure CLOCK_TICK is what we expect for unit tests
yurivict271 points out that several tests of ours are failing on FreeBSD. First
one is a unit test. The values are based on a CLOCK_TICK constant so that's
probably why our results differ.
======================================================================
FAIL: test_stats
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
return func(*args, **keywargs)
File "/usr/ports/security/py-stem/work/stem-1.5.4/test/unit/util/proc.py", line 138, in test_stats
self.assertEqual(response, proc.stats(24062, *args))
AssertionError: Tuples differ: ('0.13',) != ('0.1015625',)
First differing element 0:
'0.13'
'0.1015625'
- ('0.13',)
+ ('0.1015625',)
----------------------------------------------------------------------
Ran 10 tests in 0.021s
| -rw-r--r-- | test/unit/util/proc.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/unit/util/proc.py b/test/unit/util/proc.py index b4e3aab5..a172fcb4 100644 --- a/test/unit/util/proc.py +++ b/test/unit/util/proc.py @@ -100,6 +100,7 @@ class TestProc(unittest.TestCase): @patch('stem.util.proc._get_line') @patch('stem.util.proc.system_start_time', Mock(return_value = 10)) + @patch('stem.util.proc.CLOCK_TICKS', 100) def test_stats(self, get_line_mock): """ Tests stats() with all combinations of stat_type arguments. |
