@@ -1589,7 +1589,7 @@ def test_unsubscribe_custom_data_with_client_id(self) -> None:
1589
1589
assert self .data_engine .command_count == 2
1590
1590
assert len (actor .msgbus .subscriptions ()) == 4 # Portfolio subscriptions only
1591
1591
1592
- def test_subscribe_order_book_at_interval (self ) -> None :
1592
+ def test_subscribe_order_book_deltas (self ) -> None :
1593
1593
# Arrange
1594
1594
actor = MockActor ()
1595
1595
actor .register_base (
@@ -1600,12 +1600,12 @@ def test_subscribe_order_book_at_interval(self) -> None:
1600
1600
)
1601
1601
1602
1602
# Act
1603
- actor .subscribe_order_book_at_interval (AUDUSD_SIM .id , book_type = BookType .L2_MBP )
1603
+ actor .subscribe_order_book_deltas (AUDUSD_SIM .id , book_type = BookType .L2_MBP )
1604
1604
1605
1605
# Assert
1606
1606
assert self .data_engine .command_count == 1
1607
1607
1608
- def test_unsubscribe_order_book_at_interval (self ) -> None :
1608
+ def test_unsubscribe_order_book_deltas (self ) -> None :
1609
1609
# Arrange
1610
1610
actor = MockActor ()
1611
1611
actor .register_base (
@@ -1615,15 +1615,15 @@ def test_unsubscribe_order_book_at_interval(self) -> None:
1615
1615
clock = self .clock ,
1616
1616
)
1617
1617
1618
- actor .subscribe_order_book_at_interval (AUDUSD_SIM .id , book_type = BookType . L2_MBP )
1618
+ actor .subscribe_order_book_deltas (AUDUSD_SIM .id )
1619
1619
1620
1620
# Act
1621
- actor .unsubscribe_order_book_at_interval (AUDUSD_SIM .id )
1621
+ actor .unsubscribe_order_book_deltas (AUDUSD_SIM .id )
1622
1622
1623
1623
# Assert
1624
1624
assert self .data_engine .command_count == 2
1625
1625
1626
- def test_subscribe_order_book_data (self ) -> None :
1626
+ def test_subscribe_order_book_depth10 (self ) -> None :
1627
1627
# Arrange
1628
1628
actor = MockActor ()
1629
1629
actor .register_base (
@@ -1634,12 +1634,12 @@ def test_subscribe_order_book_data(self) -> None:
1634
1634
)
1635
1635
1636
1636
# Act
1637
- actor .subscribe_order_book_deltas (AUDUSD_SIM .id , book_type = BookType .L2_MBP )
1637
+ actor .subscribe_order_book_depth (AUDUSD_SIM .id , book_type = BookType .L2_MBP , depth = 10 )
1638
1638
1639
1639
# Assert
1640
1640
assert self .data_engine .command_count == 1
1641
1641
1642
- def test_unsubscribe_order_book_deltas (self ) -> None :
1642
+ def test_unsubscribe_order_book_depth10 (self ) -> None :
1643
1643
# Arrange
1644
1644
actor = MockActor ()
1645
1645
actor .register_base (
@@ -1649,10 +1649,44 @@ def test_unsubscribe_order_book_deltas(self) -> None:
1649
1649
clock = self .clock ,
1650
1650
)
1651
1651
1652
- actor .unsubscribe_order_book_deltas (AUDUSD_SIM .id )
1652
+ actor .subscribe_order_book_depth (AUDUSD_SIM .id , book_type = BookType . L2_MBP , depth = 10 )
1653
1653
1654
1654
# Act
1655
- actor .unsubscribe_order_book_deltas (AUDUSD_SIM .id )
1655
+ actor .unsubscribe_order_book_depth (AUDUSD_SIM .id )
1656
+
1657
+ # Assert
1658
+ assert self .data_engine .command_count == 2
1659
+
1660
+ def test_subscribe_order_book_at_interval (self ) -> None :
1661
+ # Arrange
1662
+ actor = MockActor ()
1663
+ actor .register_base (
1664
+ portfolio = self .portfolio ,
1665
+ msgbus = self .msgbus ,
1666
+ cache = self .cache ,
1667
+ clock = self .clock ,
1668
+ )
1669
+
1670
+ # Act
1671
+ actor .subscribe_order_book_at_interval (AUDUSD_SIM .id , book_type = BookType .L2_MBP )
1672
+
1673
+ # Assert
1674
+ assert self .data_engine .command_count == 1
1675
+
1676
+ def test_unsubscribe_order_book_at_interval (self ) -> None :
1677
+ # Arrange
1678
+ actor = MockActor ()
1679
+ actor .register_base (
1680
+ portfolio = self .portfolio ,
1681
+ msgbus = self .msgbus ,
1682
+ cache = self .cache ,
1683
+ clock = self .clock ,
1684
+ )
1685
+
1686
+ actor .subscribe_order_book_at_interval (AUDUSD_SIM .id , book_type = BookType .L2_MBP )
1687
+
1688
+ # Act
1689
+ actor .unsubscribe_order_book_at_interval (AUDUSD_SIM .id )
1656
1690
1657
1691
# Assert
1658
1692
assert self .data_engine .command_count == 2
0 commit comments