nvidia-nat-test 1.3.0a20250923__py3-none-any.whl → 1.3.0a20250924__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nat/test/plugin.py CHANGED
@@ -22,13 +22,6 @@ def pytest_addoption(parser: pytest.Parser):
22
22
  """
23
23
  Adds command line options for running specfic tests that are disabled by default
24
24
  """
25
- parser.addoption(
26
- "--run_e2e",
27
- action="store_true",
28
- dest="run_e2e",
29
- help="Run end to end tests that would otherwise be skipped",
30
- )
31
-
32
25
  parser.addoption(
33
26
  "--run_integration",
34
27
  action="store_true",
@@ -54,10 +47,6 @@ def pytest_addoption(parser: pytest.Parser):
54
47
 
55
48
 
56
49
  def pytest_runtest_setup(item):
57
- if (not item.config.getoption("--run_e2e")):
58
- if (item.get_closest_marker("e2e") is not None):
59
- pytest.skip("Skipping end to end tests by default. Use --run_e2e to enable")
60
-
61
50
  if (not item.config.getoption("--run_integration")):
62
51
  if (item.get_closest_marker("integration") is not None):
63
52
  pytest.skip("Skipping integration tests by default. Use --run_integration to enable")
@@ -155,6 +144,39 @@ def nvidia_api_key_fixture(fail_missing: bool):
155
144
  fail_missing=fail_missing)
156
145
 
157
146
 
147
+ @pytest.fixture(name="serp_api_key", scope='session')
148
+ def serp_api_key_fixture(fail_missing: bool):
149
+ """
150
+ Use for integration tests that require a SERP API key.
151
+ """
152
+ yield require_env_variables(
153
+ varnames=["SERP_API_KEY"],
154
+ reason="SERP integration tests require the `SERP_API_KEY` environment variable to be defined.",
155
+ fail_missing=fail_missing)
156
+
157
+
158
+ @pytest.fixture(name="tavily_api_key", scope='session')
159
+ def tavily_api_key_fixture(fail_missing: bool):
160
+ """
161
+ Use for integration tests that require a Tavily API key.
162
+ """
163
+ yield require_env_variables(
164
+ varnames=["TAVILY_API_KEY"],
165
+ reason="Tavily integration tests require the `TAVILY_API_KEY` environment variable to be defined.",
166
+ fail_missing=fail_missing)
167
+
168
+
169
+ @pytest.fixture(name="mem0_api_key", scope='session')
170
+ def mem0_api_key_fixture(fail_missing: bool):
171
+ """
172
+ Use for integration tests that require a Mem0 API key.
173
+ """
174
+ yield require_env_variables(
175
+ varnames=["MEM0_API_KEY"],
176
+ reason="Mem0 integration tests require the `MEM0_API_KEY` environment variable to be defined.",
177
+ fail_missing=fail_missing)
178
+
179
+
158
180
  @pytest.fixture(name="aws_keys", scope='session')
159
181
  def aws_keys_fixture(fail_missing: bool):
160
182
  """
@@ -40,6 +40,7 @@ from nat.data_models.retriever import RetrieverBaseConfig
40
40
  from nat.data_models.ttc_strategy import TTCStrategyBaseConfig
41
41
  from nat.experimental.test_time_compute.models.stage_enums import PipelineTypeEnum
42
42
  from nat.experimental.test_time_compute.models.stage_enums import StageTypeEnum
43
+ from nat.memory.interfaces import MemoryEditor
43
44
  from nat.object_store.interfaces import ObjectStore
44
45
  from nat.runtime.loader import PluginTypes
45
46
  from nat.runtime.loader import discover_and_register_plugins
@@ -132,7 +133,7 @@ class MockBuilder(Builder):
132
133
  """Mock implementation - not used in tool testing."""
133
134
  raise NotImplementedError("Mock implementation does not support add_function")
134
135
 
135
- def get_function(self, name: str) -> Function:
136
+ async def get_function(self, name: str) -> Function:
136
137
  """Return a mock function if one is configured."""
137
138
  if name in self._mocks:
138
139
  mock_fn = AsyncMock()
@@ -148,7 +149,7 @@ class MockBuilder(Builder):
148
149
  """Mock implementation - not used in tool testing."""
149
150
  raise NotImplementedError("Mock implementation does not support add_function_group")
150
151
 
151
- def get_function_group(self, name: str) -> FunctionGroup:
152
+ async def get_function_group(self, name: str) -> FunctionGroup:
152
153
  """Return a mock function group if one is configured."""
153
154
  if name in self._mocks:
154
155
  mock_fn_group = MagicMock(spec=FunctionGroup)
@@ -176,11 +177,11 @@ class MockBuilder(Builder):
176
177
  """Mock implementation."""
177
178
  return FunctionBaseConfig()
178
179
 
179
- def get_tools(self, tool_names: Sequence[str], wrapper_type):
180
+ async def get_tools(self, tool_names: Sequence[str], wrapper_type) -> list[typing.Any]:
180
181
  """Mock implementation."""
181
182
  return []
182
183
 
183
- def get_tool(self, fn_name: str, wrapper_type):
184
+ async def get_tool(self, fn_name: str, wrapper_type) -> typing.Any:
184
185
  """Mock implementation."""
185
186
  pass
186
187
 
@@ -220,11 +221,10 @@ class MockBuilder(Builder):
220
221
  """Mock implementation."""
221
222
  return EmbedderBaseConfig()
222
223
 
223
- async def add_memory_client(self, name: str, config) -> None:
224
- """Mock implementation."""
225
- pass
224
+ async def add_memory_client(self, name: str, config) -> MemoryEditor:
225
+ return MagicMock(spec=MemoryEditor)
226
226
 
227
- def get_memory_client(self, memory_name: str):
227
+ async def get_memory_client(self, memory_name: str) -> MemoryEditor:
228
228
  """Return a mock memory client if one is configured."""
229
229
  key = f"memory_{memory_name}"
230
230
  if key in self._mocks:
@@ -255,9 +255,9 @@ class MockBuilder(Builder):
255
255
  """Mock implementation."""
256
256
  return RetrieverBaseConfig()
257
257
 
258
- async def add_object_store(self, name: str, config: ObjectStoreBaseConfig) -> None:
258
+ async def add_object_store(self, name: str, config: ObjectStoreBaseConfig) -> ObjectStore:
259
259
  """Mock implementation for object store."""
260
- pass
260
+ return MagicMock(spec=ObjectStore)
261
261
 
262
262
  async def get_object_store_client(self, object_store_name: str) -> ObjectStore:
263
263
  """Return a mock object store client if one is configured."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nvidia-nat-test
3
- Version: 1.3.0a20250923
3
+ Version: 1.3.0a20250924
4
4
  Summary: Testing utilities for NeMo Agent toolkit
5
5
  Keywords: ai,rag,agents
6
6
  Classifier: Programming Language :: Python
@@ -9,7 +9,7 @@ Classifier: Programming Language :: Python :: 3.12
9
9
  Classifier: Programming Language :: Python :: 3.13
10
10
  Requires-Python: <3.14,>=3.11
11
11
  Description-Content-Type: text/markdown
12
- Requires-Dist: nvidia-nat==v1.3.0a20250923
12
+ Requires-Dist: nvidia-nat==v1.3.0a20250924
13
13
  Requires-Dist: langchain-community~=0.3
14
14
  Requires-Dist: pytest~=8.3
15
15
 
@@ -5,11 +5,11 @@ nat/test/functions.py,sha256=0ScrdsjcxCsPRLnyb5gfwukmvZxFi_ptCswLSIG0DVY,3095
5
5
  nat/test/llm.py,sha256=osJWGsJN7x-JGOaitueKeSwuJPVmnIFqJUCz28ngSRg,8215
6
6
  nat/test/memory.py,sha256=xki_A2yiMhEZuQk60K7t04QRqf32nQqnfzD5Iv7fkvw,1456
7
7
  nat/test/object_store_tests.py,sha256=PyJioOtoSzILPq6LuD-sOZ_89PIcgXWZweoHBQpK2zQ,4281
8
- nat/test/plugin.py,sha256=sMZ7xupCgEpQCuwUksUDYMjbBj0VNlhR6SK5UcOrBzg,6953
8
+ nat/test/plugin.py,sha256=ZADryykR1lgwoLJtD5JfUaN0aV_n8zGdxYnb4ywknbY,7749
9
9
  nat/test/register.py,sha256=FZLjc3-G1lniSUJ3qVOr0aQ-aoH1F493JMFtKbZG56w,877
10
- nat/test/tool_test_runner.py,sha256=Yww9846TwtYqSBB_4CP2q3a7QD6AzLoxP0fHTuwSX_o,21544
11
- nvidia_nat_test-1.3.0a20250923.dist-info/METADATA,sha256=Oq_mC5oOx0YSKApkUlHrSs2xGy821Ly8IvJ13smb2hI,1619
12
- nvidia_nat_test-1.3.0a20250923.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
- nvidia_nat_test-1.3.0a20250923.dist-info/entry_points.txt,sha256=7dOP9XB6iMDqvav3gYx9VWUwA8RrFzhbAa8nGeC8e4Y,99
14
- nvidia_nat_test-1.3.0a20250923.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
15
- nvidia_nat_test-1.3.0a20250923.dist-info/RECORD,,
10
+ nat/test/tool_test_runner.py,sha256=SxavwXHkvCQDl_PUiiiqgvGfexKJJTeBdI5i1qk6AzI,21712
11
+ nvidia_nat_test-1.3.0a20250924.dist-info/METADATA,sha256=F07xuU1xTu9pLwPr1xwjCwYrlx-hMhhGlNRAW17ESnk,1619
12
+ nvidia_nat_test-1.3.0a20250924.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
+ nvidia_nat_test-1.3.0a20250924.dist-info/entry_points.txt,sha256=7dOP9XB6iMDqvav3gYx9VWUwA8RrFzhbAa8nGeC8e4Y,99
14
+ nvidia_nat_test-1.3.0a20250924.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
15
+ nvidia_nat_test-1.3.0a20250924.dist-info/RECORD,,