Results of 1 - 10 of about 174 for expected (0.010 sec.)
- unittest.mock --- 入門 — Python 3.14.8 ドキュメント 10520
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- 入門 テーマ 自動 ライト ダーク | unittest.mock --- 入門 ¶ Added in version 3.3. Mock を使う ¶ Mock p
...起こらなかったことまでテストできるので便利です: mock_calls と比較するリストを作るために call オブジェクトを利用できます: >>> expected = [ call . method (), call . attribute . method ( 10 , x = 53 )] >>> mock . mock_calls == expected True However, parameter...lue >>> cursor . execute . return_value = [ 'foo' ] >>> mock . connection . cursor () . execute ( "SELECT 1" ) ['foo'] >>> expected = call . connection . cursor () . execute ( "SELECT 1" ) . call_list () >>> mock . mock_calls [call.connection.cursor(), c...all.connection.cursor().execute('SELECT 1')] >>> mock . mock_calls == expected True call object を chained call を表す list にするために .call_list() を使います。 モックから例外を発生させる ¶ side_effe... - https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
- unittest.mock --- 入門 — Python 3.14.8 ドキュメント 10520
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- 入門 テーマ 自動 ライト ダーク | unittest.mock --- 入門 ¶ Added in version 3.3. Mock を使う ¶ Mock p
...起こらなかったことまでテストできるので便利です: mock_calls と比較するリストを作るために call オブジェクトを利用できます: >>> expected = [ call . method (), call . attribute . method ( 10 , x = 53 )] >>> mock . mock_calls == expected True However, parameter...lue >>> cursor . execute . return_value = [ 'foo' ] >>> mock . connection . cursor () . execute ( "SELECT 1" ) ['foo'] >>> expected = call . connection . cursor () . execute ( "SELECT 1" ) . call_list () >>> mock . mock_calls [call.connection.cursor(), c...all.connection.cursor().execute('SELECT 1')] >>> mock . mock_calls == expected True call object を chained call を表す list にするために .call_list() を使います。 モックから例外を発生させる ¶ side_effe... - https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
- importlib.resources.abc -- リソースの抽象基底クラス — Python 3.14.8 ドキュメン... 9814
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » モジュールのインポート » importlib.resources.abc -- リソースの抽象基底クラス テーマ 自動 ライト ダーク | importlib.resources.abc --
...file(s) are stored e.g. in a zip file versus on the file system. For any of methods of this class, a resource argument is expected to be a path-like object which represents conceptually just a file name. This means that no subdirectory paths should be i...aphor for directories and file names is packages and resources, respectively. This is also why instances of this class are expected to directly correlate to a specific package (instead of potentially representing multiple packages or a module). Loaders t...hat wish to support resource reading are expected to provide a method called get_resource_reader(fullname) which returns an object implementing this ABC's interface. If the... - https://man.mtool.work/python/3.14/library/importlib.resources.abc.html
- importlib.resources.abc -- リソースの抽象基底クラス — Python 3.14.8 ドキュメン... 9814
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » モジュールのインポート » importlib.resources.abc -- リソースの抽象基底クラス テーマ 自動 ライト ダーク | importlib.resources.abc --
...file(s) are stored e.g. in a zip file versus on the file system. For any of methods of this class, a resource argument is expected to be a path-like object which represents conceptually just a file name. This means that no subdirectory paths should be i...aphor for directories and file names is packages and resources, respectively. This is also why instances of this class are expected to directly correlate to a specific package (instead of potentially representing multiple packages or a module). Loaders t...hat wish to support resource reading are expected to provide a method called get_resource_reader(fullname) which returns an object implementing this ABC's interface. If the... - https://man.mtool.work/python/3.14/library/importlib.resources.abc.html
- デスクリプタ ガイド — Python 3.14.8 ドキュメント 9288
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » デスクリプタ ガイド テーマ 自動 ライト ダーク | デスクリプタ ガイド ¶ Author : Raymond Hettinger Contact : <python at rcn dot com> デスクリプタ を
...): self . options = set ( options ) def validate ( self , value ): if value not in self . options : raise ValueError ( f 'Expected { value !r} to be one of { self . options !r} ' ) class Number ( Validator ): def __init__ ( self , minvalue = None , maxv...lf . maxvalue = maxvalue def validate ( self , value ): if not isinstance ( value , ( int , float )): raise TypeError ( f 'Expected { value !r} to be an int or float' ) if self . minvalue is not None and value < self . minvalue : raise ValueError ( f 'Ex...o be at least { self . minvalue !r} ' ) if self . maxvalue is not None and value > self . maxvalue : raise ValueError ( f 'Expected { value !r} to be no more than { self . maxvalue !r} ' ) class String ( Validator ): def __init__ ( self , minsize = None... - https://man.mtool.work/python/3.14/howto/descriptor.html
- デスクリプタ ガイド — Python 3.14.8 ドキュメント 9288
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » デスクリプタ ガイド テーマ 自動 ライト ダーク | デスクリプタ ガイド ¶ Author : Raymond Hettinger Contact : <python at rcn dot com> デスクリプタ を
...): self . options = set ( options ) def validate ( self , value ): if value not in self . options : raise ValueError ( f 'Expected { value !r} to be one of { self . options !r} ' ) class Number ( Validator ): def __init__ ( self , minvalue = None , maxv...lf . maxvalue = maxvalue def validate ( self , value ): if not isinstance ( value , ( int , float )): raise TypeError ( f 'Expected { value !r} to be an int or float' ) if self . minvalue is not None and value < self . minvalue : raise ValueError ( f 'Ex...o be at least { self . minvalue !r} ' ) if self . maxvalue is not None and value > self . maxvalue : raise ValueError ( f 'Expected { value !r} to be no more than { self . maxvalue !r} ' ) class String ( Validator ): def __init__ ( self , minsize = None... - https://man.mtool.work/python/3.14/howto/descriptor.html
- 整数型オブジェクト (integer object) — Python 3.14.8 ドキュメント 8593
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 具象オブジェクト (concrete object) レイヤ » 整数型オブジェクト (integer object) テーマ 自動 ライト ダーク | 整数型オブジェクト (i
...nction can be called twice: first to determine the buffer size, then to fill it: // Ask how much space we need. Py_ssize_t expected = PyLong_AsNativeBytes ( pylong , NULL , 0 , -1 ); if ( expected < 0 ) { // Failed. A Python exception was set with the re...ason. return NULL ; } assert ( expected != 0 ); // Impossible per the API definition. uint8_t * bignum = malloc ( expected ); if ( ! bignum ) { PyErr_SetString (...oc failed." ); return NULL ; } // Safely get the entire value. Py_ssize_t bytes = PyLong_AsNativeBytes ( pylong , bignum , expected , -1 ); if ( bytes < 0 ) { // Exception has been set. free ( bignum ); return NULL ; } else if ( bytes > expected ) { // T... - https://man.mtool.work/python/3.14/c-api/long.html
- 整数型オブジェクト (integer object) — Python 3.14.8 ドキュメント 8593
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 具象オブジェクト (concrete object) レイヤ » 整数型オブジェクト (integer object) テーマ 自動 ライト ダーク | 整数型オブジェクト (i
...nction can be called twice: first to determine the buffer size, then to fill it: // Ask how much space we need. Py_ssize_t expected = PyLong_AsNativeBytes ( pylong , NULL , 0 , -1 ); if ( expected < 0 ) { // Failed. A Python exception was set with the re...ason. return NULL ; } assert ( expected != 0 ); // Impossible per the API definition. uint8_t * bignum = malloc ( expected ); if ( ! bignum ) { PyErr_SetString (...oc failed." ); return NULL ; } // Safely get the entire value. Py_ssize_t bytes = PyLong_AsNativeBytes ( pylong , bignum , expected , -1 ); if ( bytes < 0 ) { // Exception has been set. free ( bignum ); return NULL ; } else if ( bytes > expected ) { // T... - https://man.mtool.work/python/3.14/c-api/long.html
- unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 8066
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ
...mock.method()' id='...'> >>> mock . method . assert_called_once () Traceback (most recent call last): ... AssertionError : Expected 'method' to have been called once. Called 2 times. Calls: [call(), call()]. Added in version 3.6. assert_called_with ( * a...) >>> mock . assert_called_once_with ( 'other' , bar = 'values' ) Traceback (most recent call last): ... AssertionError : Expected 'mock' to be called once. Called 2 times. Calls: [call('foo', bar='baz'), call('other', bar='values')]. assert_any_call (...led () >>> obj = m . hello () >>> m . hello . assert_not_called () Traceback (most recent call last): ... AssertionError : Expected 'hello' to not have been called. Called 1 times. Calls: [call()]. Added in version 3.5. reset_mock ( * , return_value = Fa... - https://man.mtool.work/python/3.14/library/unittest.mock.html
- unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 8066
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ
...mock.method()' id='...'> >>> mock . method . assert_called_once () Traceback (most recent call last): ... AssertionError : Expected 'method' to have been called once. Called 2 times. Calls: [call(), call()]. Added in version 3.6. assert_called_with ( * a...) >>> mock . assert_called_once_with ( 'other' , bar = 'values' ) Traceback (most recent call last): ... AssertionError : Expected 'mock' to be called once. Called 2 times. Calls: [call('foo', bar='baz'), call('other', bar='values')]. assert_any_call (...led () >>> obj = m . hello () >>> m . hello . assert_not_called () Traceback (most recent call last): ... AssertionError : Expected 'hello' to not have been called. Called 1 times. Calls: [call()]. Added in version 3.5. reset_mock ( * , return_value = Fa... - https://man.mtool.work/python/3.14/library/unittest.mock.html