添加mumu-pytest测试框架
This commit is contained in:
27
mumu-pytest/test_mumu.py
Normal file
27
mumu-pytest/test_mumu.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""
|
||||
Mumu模拟器测试
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def test_start_emulator_sequence(emulator):
|
||||
"""测试模拟器启动和操作序列"""
|
||||
assert not emulator.is_running(), "模拟器已启动"
|
||||
emulator.start()
|
||||
assert emulator.is_running(), "模拟器启动失败"
|
||||
|
||||
|
||||
def test_run_sequence(emulator):
|
||||
"""测试按顺序执行任务"""
|
||||
if not emulator.is_running():
|
||||
pytest.skip("模拟器未运行")
|
||||
|
||||
emulator.run_sequence()
|
||||
|
||||
|
||||
def test_close_emulator(emulator):
|
||||
"""测试关闭模拟器"""
|
||||
if emulator.is_running():
|
||||
emulator.close()
|
||||
assert not emulator.is_running(), "模拟器关闭失败"
|
||||
Reference in New Issue
Block a user