私の課題の一部は、各関数のテストを作成することです。これはちょっと長いですが、私はとても混乱しています。
この関数の下にリンクを置いたので、最初のコードが非常に長いため、どのように見えるかがわかります。
def load_profiles(profiles_file, person_to_friends, person_to_networks):
'''(file, dict of {str : list of strs}, dict of {str : list of strs}) -> NoneType
Update person to friends and person to networks dictionaries to include
the data in open file.'''
# for updating person_to_friends dict
update_p_to_f(profiles_file, person_to_friends)
update_p_to_n(profiles_file, person_to_networks)
コード全体をここに示します: http://shrib.com/8EF4E8Z3、メインブロックでテストしたところ、動作しました。これは、提供されたテキスト ファイル (profiles_file) で、変換に使用しています: http://shrib.com/zI61fmNP
これのテストケースを実行するにはどうすればよいですか? どのようなテスト結果がありますか? それとも、私は十分に具体的ではありませんか?
鼻のインポート a3_functions のインポート
def test_load_profiles_
if name == ' main ': noise.runmodule() そこまで行ったので、関数に対して何をテストできるかわかりませんでした。