Skip to content
Snippets Groups Projects
Commit ac240235 authored by Carsten Hinz's avatar Carsten Hinz
Browse files

fixed some typos.

Tests are not yet working.
parent f90dee30
Branches
Tags
1 merge request!11Creation of first beta release version
......@@ -18,7 +18,7 @@ def test_process_input_files(mock_exists):
# Check if the output file was written as expected
mock_open = mock.mock_open()
with mock.patch('builtins.open', mock_open):
combine_contribitors_files.main()
combine_contributor_files.main()
mock_open.assert_called_with('output.txt', 'w')
handle = mock_open()
handle.write.assert_called_with("1\n2\n3\n")
......@@ -47,12 +47,9 @@ def test_invalid_timeseries_id():
# Verify
mock_log_exception.assert_called_with('Invalid timeseries id: invalid. Expecting integer.')
from unittest import mock
import combine_contributors_files
@mock.patch('os.path.exists', return_value=True)
@mock.patch('builtins.open', mock.mock_open())
@mock.patch('combine_contributors_files.toargridding_defaultLogging')
@mock.patch('combine_contributor_files.toargridding_defaultLogging')
def test_combine_files_with_duplicate_ids(mock_logging_setup):
# Mock input files content
mock_open = mock.mock_open(read_data="1\n2\n3\n")
......@@ -65,7 +62,7 @@ def test_combine_files_with_duplicate_ids(mock_logging_setup):
# Setup arguments to mimic command-line input
test_args = ["script_name", "--input_files", "file1.txt", "file2.txt", "file3.txt", "--output", "output.txt"]
with mock.patch('sys.argv', test_args), mock.patch('builtins.open', mock_open):
combine_contributors_files.main() # Assuming your script has a main function to initiate processing
combine_contributor_files.main() # Assuming your script has a main function to initiate processing
# Verify that the output file was written correctly
# Expected output: 1, 2, 3, 4, 5, 6, 7, 8 (each number on a new line, sorted)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment