示例#1
0
    def test_gas_price_should_stay_the_same(self):
        # given
        value = 9000000000
        fixed_gas_price = FixedGasPrice(value)

        # expect
        assert fixed_gas_price.get_gas_price(0) == value
        assert fixed_gas_price.get_gas_price(1) == value
        assert fixed_gas_price.get_gas_price(2) == value
        assert fixed_gas_price.get_gas_price(5) == value
        assert fixed_gas_price.get_gas_price(60) == value
        assert fixed_gas_price.get_gas_price(120) == value
        assert fixed_gas_price.get_gas_price(600) == value
        assert fixed_gas_price.get_gas_price(1000000) == value
示例#2
0
    def test_gas_price_should_be_updated_by_update_gas_price_method(self):
        # given
        value1 = 9000000000
        value2 = 16000000000

        # and
        fixed_gas_price = FixedGasPrice(value1)

        # and
        assert fixed_gas_price.get_gas_price(0) == value1
        assert fixed_gas_price.get_gas_price(1) == value1
        assert fixed_gas_price.get_gas_price(2) == value1
        assert fixed_gas_price.get_gas_price(5) == value1

        # when
        fixed_gas_price.update_gas_price(value2)

        # then
        assert fixed_gas_price.get_gas_price(60) == value2
        assert fixed_gas_price.get_gas_price(120) == value2
        assert fixed_gas_price.get_gas_price(600) == value2