Пример #1
0
def test_multiplication():
    five = Dollar(5)
    assert Dollar(10) == five.times(2)
    assert Dollar(15) == five.times(3)
Пример #2
0
def test_multiplication():
    five = Dollar(5)
    product = five.times(2)
    assert 10 == product.amount
    product = five.times(3)
    assert 15 == product.amount
Пример #3
0
def test_equality():
    assert Dollar(5) == Dollar(5)
    assert Dollar(5) != Dollar(6)
Пример #4
0
def main():

    five = Dollar.Dollar(5)
    product = five.times(2)
    print(product.amount)
Пример #5
0
 def test_multiplication(self):
     five = Dollar(5)
     product = five.times(2)
     self.assertEquals(10, product.amount)
     product = five.times(3)
     self.assertEquals(15, product.amount)
Пример #6
0
def test_multiplication():
    five = Dollar(5)
    five.times(2)
    assert 10 == five.amount
Пример #7
0
def test_multiplication():
    five = Dollar(5, "USD")
    assert Dollar(10, "USD") == five.times(2)
    assert Dollar(15, "USD") == five.times(3)
Пример #8
0
def test_currency():
    assert Dollar(5, "USD").currency is "USD"
    assert Franc(5, "CHF").currency is "CHF"
Пример #9
0
def test_equality():
    assert (Dollar(5, "USD") == Dollar(5, "USD")) is True
    assert (Franc(5, "CHF") == Franc(5, "CHF")) is True
    assert (Money(5, "USD") == Money(5, "USD")) is True
Пример #10
0
def test_equality():
    assert Dollar(5) == Dollar(5)
    assert Dollar(5) != Dollar(6)
    assert Franc(5) == Franc(5)
    assert Franc(5) != Franc(6)