feat: show open grid lots
This commit is contained in:
@@ -55,6 +55,26 @@ def test_main_window_contains_grid_level_table(tmp_path, monkeypatch):
|
||||
app.processEvents()
|
||||
|
||||
|
||||
def test_main_window_contains_open_grid_lots_table(tmp_path, monkeypatch):
|
||||
monkeypatch.setenv("QT_QPA_PLATFORM", "offscreen")
|
||||
|
||||
from PySide6.QtWidgets import QApplication, QGroupBox
|
||||
|
||||
from grid_trading.services.trading_service import TradingService
|
||||
from grid_trading.ui.main_window import MainWindow
|
||||
|
||||
app = QApplication.instance() or QApplication([])
|
||||
service = TradingService(tmp_path / "grid.db")
|
||||
window = MainWindow(service)
|
||||
|
||||
assert window.open_grid_lots_table.columnCount() == 8
|
||||
assert any(group.title() == "待卖网格" for group in window.findChildren(QGroupBox))
|
||||
|
||||
window.close()
|
||||
service.close()
|
||||
app.processEvents()
|
||||
|
||||
|
||||
def test_instrument_dialog_does_not_collect_manual_current_price(monkeypatch):
|
||||
monkeypatch.setenv("QT_QPA_PLATFORM", "offscreen")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user