Example #1
0
    def test_to_serializable_string(self):
        # Arrange
        bar = Bar(
            Price("1.00001"),
            Price("1.00004"),
            Price("1.00002"),
            Price("1.00003"),
            Quantity(100000),
            UNIX_EPOCH,
        )

        # Act
        serializable = bar.to_serializable_str()

        # Assert
        assert "1.00001,1.00004,1.00002,1.00003,100000,0" == serializable
    def test_to_serializable_string(self):
        # Arrange
        bar = Bar(
            AUDUSD_1_MIN_BID,
            Price("1.00001"),
            Price("1.00004"),
            Price("1.00002"),
            Price("1.00003"),
            Quantity(100000),
            0,
        )

        # Act
        serializable = bar.to_serializable_str()

        # Assert
        assert serializable == "1.00001,1.00004,1.00002,1.00003,100000,0"