Did I find the right examples for you? yes no

All Samples(7)  |  Call(7)  |  Derive(0)  |  Import(0)

src/m/o/mongothon-HEAD/tests/mongothon/model_test.py   mongothon(Download)
    def setUp(self):
        self.mock_collection = Mock()
        self.mock_collection.name = "car"
        self.Car = create_model(car_schema, self.mock_collection)
        self.car = self.Car(doc)
    def test_did_init_event(self):
        handler = Mock()
        self.Car.on('did_init', handler)
        car = self.Car()
        handler.assert_called_once_with(car)
    def test_did_find_event_not_fire_for_simple_init(self):
        handler = Mock()
        self.Car.on('did_find', handler)
        self.Car()
        self.assertFalse(handler.called)
            stub(*args, **kwargs)
 
        car = self.Car()
        stub.assert_called_once_with(car)
 
    def test_remove_handler(self):
        handler = Mock()
        self.Car.on('did_init', handler)
        self.Car.remove_handler('did_init', handler)
        self.Car()