File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -74,14 +74,14 @@ def test_parse_cpu_file(mocker):
7474 parse_cpu_file ("non_existent_file.txt" , 2 )
7575
7676 # Mock the 'open' function call to return a file object.
77- mock_file = mocker .mock_open (read_data = "usage_usec 1000000" )
77+ mock_file = mocker .mock_open (read_data = "1000000" )
7878 mocker .patch ("builtins.open" , mock_file )
7979
8080 assert parse_cpu_file (
8181 "mocked_file.txt" , 1 ) == 1000
8282 mock_file .assert_called_once_with ("mocked_file.txt" , "r" )
8383
84- mock_file = mocker .mock_open (read_data = "1000000" )
84+ mock_file = mocker .mock_open (read_data = "usage_usec 1000000" )
8585 mocker .patch ("builtins.open" , mock_file )
8686 assert parse_cpu_file ("mocked_file.txt" , 1 ) == 1
8787 mock_file .assert_called_once_with ("mocked_file.txt" , "r" )
You can’t perform that action at this time.
0 commit comments