mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-27 04:20:09 +00:00
- Remove all unconditional pytest.skip() calls - Fix file content tests to handle both strict/non-strict modes - Fix missing device_capabilities module in hanzo-network - Fix HanzoNetProvider imports and exports - Fix local_llm.py import errors - Create test helper classes for pagination tests - Fix FastMCP paginator test constructor args - Configure all API keys from ~/.zsh/after.zsh - All tests now pass or skip conditionally based on actual requirements
76 lines
1.7 KiB
Python
76 lines
1.7 KiB
Python
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def syntax_error_py_file(tmp_path):
|
|
file_content = """
|
|
def foo():
|
|
print("Hello, World!")
|
|
print("Wrong indent")
|
|
foo(
|
|
"""
|
|
file_path = tmp_path / "test_file.py"
|
|
file_path.write_text(file_content)
|
|
return str(file_path)
|
|
|
|
|
|
@pytest.fixture
|
|
def wrongly_indented_py_file(tmp_path):
|
|
file_content = """
|
|
def foo():
|
|
print("Hello, World!")
|
|
"""
|
|
file_path = tmp_path / "test_file.py"
|
|
file_path.write_text(file_content)
|
|
return str(file_path)
|
|
|
|
|
|
@pytest.fixture
|
|
def simple_correct_py_file(tmp_path):
|
|
file_content = 'print("Hello, World!")\n'
|
|
file_path = tmp_path / "test_file.py"
|
|
file_path.write_text(file_content)
|
|
return str(file_path)
|
|
|
|
|
|
@pytest.fixture
|
|
def simple_correct_py_func_def(tmp_path):
|
|
file_content = """def foo():
|
|
print("Hello, World!")
|
|
foo()
|
|
"""
|
|
file_path = tmp_path / "test_file.py"
|
|
file_path.write_text(file_content)
|
|
return str(file_path)
|
|
|
|
|
|
@pytest.fixture
|
|
def simple_correct_ruby_file(tmp_path):
|
|
file_content = """def foo
|
|
puts "Hello, World!"
|
|
end
|
|
foo
|
|
"""
|
|
file_path = tmp_path / "test_file.rb"
|
|
file_path.write_text(file_content)
|
|
return str(file_path)
|
|
|
|
|
|
@pytest.fixture
|
|
def simple_incorrect_ruby_file(tmp_path):
|
|
file_content = """def foo():
|
|
print("Hello, World!")
|
|
foo()
|
|
"""
|
|
file_path = tmp_path / "test_file.rb"
|
|
file_path.write_text(file_content)
|
|
return str(file_path)
|
|
|
|
|
|
@pytest.fixture
|
|
def parenthesis_incorrect_ruby_file(tmp_path):
|
|
file_content = """def print_hello_world()\n puts 'Hello World'\n"""
|
|
file_path = tmp_path / "test_file.rb"
|
|
file_path.write_text(file_content)
|
|
return str(file_path)
|