langchain/libs/community/tests/integration_tests/utilities/test_nasa.py
Bagatur ed58eeb9c5
community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463)
Moved the following modules to new package langchain-community in a backwards compatible fashion:

```
mv langchain/langchain/adapters community/langchain_community
mv langchain/langchain/callbacks community/langchain_community/callbacks
mv langchain/langchain/chat_loaders community/langchain_community
mv langchain/langchain/chat_models community/langchain_community
mv langchain/langchain/document_loaders community/langchain_community
mv langchain/langchain/docstore community/langchain_community
mv langchain/langchain/document_transformers community/langchain_community
mv langchain/langchain/embeddings community/langchain_community
mv langchain/langchain/graphs community/langchain_community
mv langchain/langchain/llms community/langchain_community
mv langchain/langchain/memory/chat_message_histories community/langchain_community
mv langchain/langchain/retrievers community/langchain_community
mv langchain/langchain/storage community/langchain_community
mv langchain/langchain/tools community/langchain_community
mv langchain/langchain/utilities community/langchain_community
mv langchain/langchain/vectorstores community/langchain_community
mv langchain/langchain/agents/agent_toolkits community/langchain_community
mv langchain/langchain/cache.py community/langchain_community
mv langchain/langchain/adapters community/langchain_community
mv langchain/langchain/callbacks community/langchain_community/callbacks
mv langchain/langchain/chat_loaders community/langchain_community
mv langchain/langchain/chat_models community/langchain_community
mv langchain/langchain/document_loaders community/langchain_community
mv langchain/langchain/docstore community/langchain_community
mv langchain/langchain/document_transformers community/langchain_community
mv langchain/langchain/embeddings community/langchain_community
mv langchain/langchain/graphs community/langchain_community
mv langchain/langchain/llms community/langchain_community
mv langchain/langchain/memory/chat_message_histories community/langchain_community
mv langchain/langchain/retrievers community/langchain_community
mv langchain/langchain/storage community/langchain_community
mv langchain/langchain/tools community/langchain_community
mv langchain/langchain/utilities community/langchain_community
mv langchain/langchain/vectorstores community/langchain_community
mv langchain/langchain/agents/agent_toolkits community/langchain_community
mv langchain/langchain/cache.py community/langchain_community
```

Moved the following to core
```
mv langchain/langchain/utils/json_schema.py core/langchain_core/utils
mv langchain/langchain/utils/html.py core/langchain_core/utils
mv langchain/langchain/utils/strings.py core/langchain_core/utils
cat langchain/langchain/utils/env.py >> core/langchain_core/utils/env.py
rm langchain/langchain/utils/env.py
```

See .scripts/community_split/script_integrations.sh for all changes
2023-12-11 13:53:30 -08:00

33 lines
1.2 KiB
Python

"""Integration test for NASA API Wrapper."""
from langchain_community.utilities.nasa import NasaAPIWrapper
def test_media_search() -> None:
"""Test for NASA Image and Video Library media search"""
nasa = NasaAPIWrapper()
query = '{"q": "saturn", + "year_start": "2002", "year_end": "2010", "page": 2}'
output = nasa.run("search_media", query)
assert output is not None
assert "collection" in output
def test_get_media_metadata_manifest() -> None:
"""Test for retrieving media metadata manifest from NASA Image and Video Library"""
nasa = NasaAPIWrapper()
output = nasa.run("get_media_metadata_manifest", "2022_0707_Recientemente")
assert output is not None
def test_get_media_metadata_location() -> None:
"""Test for retrieving media metadata location from NASA Image and Video Library"""
nasa = NasaAPIWrapper()
output = nasa.run("get_media_metadata_location", "as11-40-5874")
assert output is not None
def test_get_video_captions_location() -> None:
"""Test for retrieving video captions location from NASA Image and Video Library"""
nasa = NasaAPIWrapper()
output = nasa.run("get_video_captions_location", "172_ISS-Slosh.sr")
assert output is not None