Skip to content

Commit

Permalink
token and retry added
Browse files Browse the repository at this point in the history
  • Loading branch information
dlubom committed Jul 24, 2024
1 parent 6e47f77 commit 2b7f5be
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions tests/test_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_fetch_and_process_data_error(mock_get):

data, file_path = fetch_and_process_data("AA", CodeType.CARRIER)

assert data == "Request failed: Network error"
assert data == "Request failed after 3 attempts: Network error"
assert file_path == "carrier_data_full.jsonl"


Expand Down Expand Up @@ -176,14 +176,10 @@ def test_generate_codes_for_two_letter_codes():
"""
length = 2 # Test with two-letter codes
codes = list(generate_codes(length))
expected_number_of_codes = (
26**2
) # There are 26 letters, so 26^2 two-letter combinations
expected_number_of_codes = 26**2 # There are 26 letters, so 26^2 two-letter combinations

# Check if all codes have the correct length
assert all(
len(code) == length for code in codes
), "All codes must have the specified length of 2"
assert all(len(code) == length for code in codes), "All codes must have the specified length of 2"

# Check the total number of generated codes
assert (
Expand All @@ -201,14 +197,10 @@ def test_generate_codes_for_three_letter_codes():
"""
length = 3 # Test with three-letter codes
codes = list(generate_codes(length))
expected_number_of_codes = (
26**3
) # There are 26 letters, so 26^3 three-letter combinations
expected_number_of_codes = 26**3 # There are 26 letters, so 26^3 three-letter combinations

# Check if all codes have the correct length
assert all(
len(code) == length for code in codes
), "All codes must have the specified length of 3"
assert all(len(code) == length for code in codes), "All codes must have the specified length of 3"

# Check the total number of generated codes
assert (
Expand Down

0 comments on commit 2b7f5be

Please sign in to comment.