Skip to content
Snippets Groups Projects
Commit c3c2f4e3 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

test added

parent aee3182a
No related branches found
No related tags found
No related merge requests found
## v2.0.9
* `satella.coding.merge_dicts` added
......@@ -7,6 +7,18 @@ from satella.coding import typed, CallSignature
class TestTypecheck(unittest.TestCase):
def test_cls(self):
class Lol(object):
@typed(int)
def zomg(self, a):
return a
Lol().zomg(2)
self.assertRaises(TypeError, lambda: Lol().zomg('a'))
def test_ta(self):
@typed(int, int, returns=int)
......
# coding=UTF-8
from __future__ import print_function, absolute_import, division
import six
import unittest
from satella.coding import TimeBasedHeap
class TestTimeBasedHeap(unittest.TestCase):
def test_tbh(self):
tbh = TimeBasedHeap()
tbh.put(10, 'ala')
tbh.put(20, 'ma')
tbh.put(30, 'kota')
q = set(tbh.pop_less_than(25))
self.assertIn((10, 'ala'), q)
self.assertIn((20, 'ma'), q)
self.assertNotIn((30, 'kota'), q)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment