-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtest_basic.py
More file actions
59 lines (45 loc) · 1.55 KB
/
test_basic.py
File metadata and controls
59 lines (45 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"""Basic tests for code-conductor"""
import sys
import yaml
import requests
def test_python_version():
"""Test that we're running Python 3.9-3.12"""
assert sys.version_info >= (3, 9), f"Python 3.9-3.12 required, got {sys.version}"
assert sys.version_info < (
3,
13,
), f"Python 3.13+ not yet supported, got {sys.version}"
def test_dependencies():
"""Test that core dependencies are available"""
# Test PyYAML
assert hasattr(yaml, "__version__"), "PyYAML not available"
print(f"PyYAML version: {yaml.__version__}")
# Test Requests
assert hasattr(requests, "__version__"), "Requests not available"
print(f"Requests version: {requests.__version__}")
def test_yaml_functionality():
"""Test basic YAML functionality"""
test_data = {
"name": "test",
"version": "1.0.0",
"dependencies": ["pyyaml", "requests"],
}
# Test YAML serialization
yaml_str = yaml.dump(test_data)
assert isinstance(yaml_str, str)
# Test YAML deserialization
loaded_data = yaml.safe_load(yaml_str)
assert loaded_data == test_data
def test_requests_functionality():
"""Test basic Requests functionality"""
# Test that requests can be imported and has expected attributes
assert hasattr(requests, "get")
assert hasattr(requests, "post")
assert hasattr(requests, "Session")
if __name__ == "__main__":
# Run tests
test_python_version()
test_dependencies()
test_yaml_functionality()
test_requests_functionality()
print("✅ All basic tests passed!")