コード例 #1
0
    def test_error(self, model_manager: BaseModelManager, mocker: MockFixture):
        mocker.patch.object(model_manager, 'sql', None)

        with pytest.raises(AssertionError):
            model_manager.get_sql()
コード例 #2
0
    def test_ok(self, model_manager: BaseModelManager, mocker: MockFixture):
        fake_sql = mocker.patch.object(model_manager, 'sql')

        compared_sql = model_manager.get_sql()

        assert compared_sql == fake_sql