Correct schema write test (#1416)

<Mock>.called_once() just returns a Mock, so assert <Mock>.called_once()
always passes. We want <Mock>.assert_called_once().
This commit is contained in:
Kien Dang 2023-05-27 21:53:22 +08:00 committed by GitHub
parent 63fd98393f
commit 38709d8396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,7 @@ def test_generate_graphql_file_on_call_graphql_schema():
open_mock.assert_called_once() open_mock.assert_called_once()
handle = open_mock() handle = open_mock()
assert handle.write.called_once() handle.write.assert_called_once()
schema_output = handle.write.call_args[0][0] schema_output = handle.write.call_args[0][0]
assert schema_output == dedent( assert schema_output == dedent(