From 84482aac6f304475e673b3bd1db29c6269fda28c Mon Sep 17 00:00:00 2001 From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl> Date: Sun, 8 Oct 2017 00:05:27 +0200 Subject: [PATCH] DCS -> mock --- tests/test_coding/test_structures.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/test_coding/test_structures.py b/tests/test_coding/test_structures.py index cd012a33..836cea05 100644 --- a/tests/test_coding/test_structures.py +++ b/tests/test_coding/test_structures.py @@ -6,6 +6,7 @@ import unittest from satella.coding import TimeBasedHeap, Heap, CallableGroup import six import copy +import mock class TestCallableGroup(unittest.TestCase): @@ -35,21 +36,13 @@ class TestTimeBasedHeap(unittest.TestCase): def test_def(self): - - class DCS(object): - def __call__(self): - return self.v - def set(self, v): - self.v = v - - clk = DCS() - clk.set(0) + clk = mock.Mock(return_value=0) tbh = TimeBasedHeap(default_clock_source=clk) tbh.put('ala') tbh.put(4, 'alla') - clk.set(3) + clk.return_value = 3 q = set(tbh.pop_less_than()) -- GitLab