Results of 1 - 2 of about 2 for TestStringMethods (0.005 sec.)
- unittest --- ユニットテストフレームワーク 11228
- unittest --- ユニットテストフレームワーク ソースコード: Lib/unittest/__init__.py (すでにテストの基本概念について詳しいようでしたら、この部分をとばして アサートメソッド一覧 に進むと良いでしょう。) unittest ユニットテストフレームワークは、もと
...とんどの利用者の要求を満たせることを示します。 以下は、三つの文字列メソッドをテストするスクリプトです: import unittest class TestStringMethods ( unittest . TestCase ): def test_upper ( self ): self . assertEqual ( 'foo' . upper (), 'FOO' ) def test_isupper ( self )...プションをテストスクリプトに渡すことで unittest.main() はより冗長になり、以下のような出力をします: test_isupper ( __main__ . TestStringMethods . test_isupper ) ... ok test_split ( __main__ . TestStringMethods . test_split ) ... ok test_upper ( __main__ . TestString... - https://man.mtool.work/python/3.14/library/unittest.html
- unittest.mock --- モックオブジェクトライブラリ 7485
- unittest.mock --- モックオブジェクトライブラリ Added in version 3.3. ソースコード: Lib/unittest/mock.py unittest.mock は Python でテストを行うためのライブラリです。 テスト対象のシステムの一部をモックオブジェクトに置き換え、どのように使われた
...== [ call ( 1 ), call ( 1 , 2 ), ANY ] True ANY は call オブジェクトとの比較に限らず、テストのアサートにも使えます。 class TestStringMethods ( unittest . TestCase ): def test_split ( self ): s = 'hello world' self . assertEqual ( s . split (), [ 'hello' , ANY ])... - https://man.mtool.work/python/3.14/library/unittest.mock.html
PREV
1
NEXT