11import pytest
2- import os
3- import csv
42from unittest .mock import MagicMock
53from src .application .core .pipeline import (
64 fetch_add_data_response ,
@@ -17,7 +15,7 @@ def test_fetch_add_data_response_success(monkeypatch, tmp_path):
1715 input_path = tmp_path / "resource"
1816 specification_dir = tmp_path / "specification"
1917 cache_dir = tmp_path / "cache"
20- url = "http://example.com/endpoint "
18+ endpoint = "abc123hash "
2119
2220 input_path .mkdir (parents = True )
2321 pipeline_dir .mkdir (parents = True )
@@ -68,7 +66,7 @@ def test_fetch_add_data_response_success(monkeypatch, tmp_path):
6866 output_path = str (input_path / "output.csv" ),
6967 specification_dir = str (specification_dir ),
7068 cache_dir = str (cache_dir ),
71- url = url ,
69+ endpoint = endpoint ,
7270 )
7371
7472 assert "new-in-resource" in result
@@ -83,7 +81,7 @@ def test_fetch_add_data_response_no_files(monkeypatch, tmp_path):
8381 input_path = tmp_path / "resource"
8482 specification_dir = tmp_path / "specification"
8583 cache_dir = tmp_path / "cache"
86- url = "http://example.com/endpoint "
84+ endpoint = "abc123hash "
8785
8886 input_path .mkdir (parents = True )
8987 pipeline_dir .mkdir (parents = True )
@@ -103,7 +101,7 @@ def test_fetch_add_data_response_no_files(monkeypatch, tmp_path):
103101 output_path = str (input_path / "output.csv" ),
104102 specification_dir = str (specification_dir ),
105103 cache_dir = str (cache_dir ),
106- url = url ,
104+ endpoint = endpoint ,
107105 )
108106
109107 assert "new-in-resource" in result
@@ -118,7 +116,7 @@ def test_fetch_add_data_response_file_not_found(monkeypatch, tmp_path):
118116 input_path = tmp_path / "nonexistent"
119117 specification_dir = tmp_path / "specification"
120118 cache_dir = tmp_path / "cache"
121- url = "http://example.com/endpoint "
119+ endpoint = "abc123hash "
122120
123121 pipeline_dir .mkdir (parents = True )
124122
@@ -138,7 +136,7 @@ def test_fetch_add_data_response_file_not_found(monkeypatch, tmp_path):
138136 output_path = str (input_path / "output.csv" ),
139137 specification_dir = str (specification_dir ),
140138 cache_dir = str (cache_dir ),
141- url = url ,
139+ endpoint = endpoint ,
142140 )
143141
144142
@@ -150,7 +148,7 @@ def test_fetch_add_data_response_handles_processing_error(monkeypatch, tmp_path)
150148 input_path = tmp_path / "resource"
151149 specification_dir = tmp_path / "specification"
152150 cache_dir = tmp_path / "cache"
153- url = "http://example.com/endpoint "
151+ endpoint = "abc123hash "
154152
155153 input_path .mkdir (parents = True )
156154 pipeline_dir .mkdir (parents = True )
@@ -178,7 +176,7 @@ def raise_exception(*args, **kwargs):
178176 output_path = str (input_path / "output.csv" ),
179177 specification_dir = str (specification_dir ),
180178 cache_dir = str (cache_dir ),
181- url = url ,
179+ endpoint = endpoint ,
182180 )
183181
184182 assert "new-in-resource" in result
0 commit comments