Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(13)  |  Call(12)  |  Derive(0)  |  Import(1)

src/a/d/advanced-01-HEAD/asvetlov/tests/core/test_delayedcall.py   advanced-01(Download)
import unittest
from unittest.mock import Mock
 
from core.delayedcall import DelayedCall
 
    def test_ctor(self):
        def f(a, b):
            pass
 
        dc = DelayedCall(self.EVLOOP, self.NOW, f, (1, 2))
 
        with self.assertRaises(AssertionError):
            DelayedCall(self.EVLOOP, self.NOW, 1, ())
 
        with self.assertRaises(TypeError):
            DelayedCall(self.EVLOOP, self.NOW, f, (1, 2, 3))
    def test_skip_args(self):
        def f(a, b):
            pass
        DelayedCall(self.EVLOOP, self.NOW, 1, (), check_args=False)
        DelayedCall(self.EVLOOP, self.NOW, f, (1, 2, 3), check_args=False)