1 parent
9e7d0aeee6
commit
e64a8e9bc5
26 files changed
+1111
-77
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import pytest
|
||||
|
||||
from src.ET import ET
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def test_create_client():
|
||||
"""创建测试用的client"""
|
||||
client = ET()
|
||||
yield client
|
||||
|
||||
|
||||
def test_et_check_inject():
|
||||
"""测试注入"""
|
||||
et = ET()
|
||||
print("Injecting...")
|
||||
assert et.inject_flag is True, "Injection failed"
|
||||
print("Inject test passed!")
|
||||
|
||||
|
||||
def test_et_get_sheets():
|
||||
"""测试获取工作表"""
|
||||
et = ET()
|
||||
print("Getting sheets...")
|
||||
sheets_name = et.get_sheets()
|
||||
print(f"Retrieved {len(sheets_name)} sheets")
|
||||
print(f"Sheets_name: {sheets_name}")
|
||||
assert isinstance(sheets_name, list)
|
||||
assert len(sheets_name) > 0
|
||||
assert all(isinstance(sheet, str) for sheet in sheets_name)
|
||||
# 遍历所有工作表, 并输出
|
||||
for i, sheet in enumerate(sheets_name):
|
||||
print(f"Sheet {i}: {sheet}")
|
||||
print("First sheet in list:", sheets_name[0] if sheets_name else "None")
|
||||
print("Get sheets test passed!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
pass
|
||||
Reference in new issue
Block a user