예제 #1
0
def test_trasbordo():
    #caso de que pague un boleto de la misma linea pero diferente interno
    tarjeta3 = EMR.comun(
        0, 1, 0, datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"), 0)
    tarjeta3.recarga(20)
    tarjeta4 = EMR.medio(
        0, 144, 0, datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"), 0)
    tarjeta4.recarga(10)
    tarjeta3.pagarboleto(
        centro, datetime.strptime("25/01/2015 18:40", "%d/%m/%Y %H:%M"))
    tarjeta3.pagarboleto(
        centros, datetime.strptime("25/01/2015 18:55", "%d/%m/%Y %H:%M"))
    assert (tarjeta3.mostrarsaldo() == 12.35)
    tarjeta4.pagarboleto(
        centros, datetime.strptime("25/01/2015 18:26", "%d/%m/%Y %H:%M"))
    tarjeta4.pagarboleto(
        centro, datetime.strptime("25/01/2015 18:40", "%d/%m/%Y %H:%M"))
    assert (tarjeta4.mostrarsaldo() == 6.14)
    #caso diferente linea
    tarjeta5 = EMR.comun(
        0, 1, 0, datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"), 0)
    tarjeta5.recarga(20)
    tarjeta6 = EMR.medio(
        0, 144, 0, datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"), 0)
    tarjeta6.recarga(10)
    tarjeta5.pagarboleto(
        k, datetime.strptime("25/01/2015 18:40", "%d/%m/%Y %H:%M"))
    tarjeta5.pagarboleto(
        centros, datetime.strptime("25/01/2015 18:55", "%d/%m/%Y %H:%M"))
    assert (tarjeta5.mostrarsaldo() == 12.35)
    tarjeta6.pagarboleto(
        k, datetime.strptime("25/01/2015 18:26", "%d/%m/%Y %H:%M"))
    tarjeta6.pagarboleto(
        centro, datetime.strptime("25/01/2015 18:40", "%d/%m/%Y %H:%M"))
    assert (tarjeta6.mostrarsaldo() == 6.14)
예제 #2
0
파일: test.py 프로젝트: Fela182/EMR
def test_recargar():
    seba=EMR.comun(0,1,0,datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"),0)
    rolo=EMR.medio(0,144,0,datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"),0)
    fela=EMR.comun(0,115,0,datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"),0)
    seba.recarga(196)
    assert(seba.mostrarsaldo()==230)
    fela.recarga(10)
    assert(fela.mostrarsaldo()==10)
    rolo.recarga(368)
    assert(rolo.mostrarsaldo()==460)
예제 #3
0
def test_recargar():
    seba = EMR.comun(0, 1, 0,
                     datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"),
                     0)
    rolo = EMR.medio(0, 144, 0,
                     datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"),
                     0)
    fela = EMR.comun(0, 115, 0,
                     datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"),
                     0)
    seba.recarga(196)
    assert (seba.mostrarsaldo() == 230)
    fela.recarga(10)
    assert (fela.mostrarsaldo() == 10)
    rolo.recarga(368)
    assert (rolo.mostrarsaldo() == 460)
예제 #4
0
파일: test.py 프로젝트: Fela182/EMR
def test_trasbordo():
    #caso de que pague un boleto de la misma linea pero diferente interno
    tarjeta3=EMR.comun(0,1,0,datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"),0)
    tarjeta3.recarga(20)
    tarjeta4=EMR.medio(0,144,0,datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"),0)
    tarjeta4.recarga(10)
    tarjeta3.pagarboleto(centro,datetime.strptime("25/01/2015 18:40", "%d/%m/%Y %H:%M"))
    tarjeta3.pagarboleto(centros,datetime.strptime("25/01/2015 18:55", "%d/%m/%Y %H:%M"))
    assert(tarjeta3.mostrarsaldo()==12.35)
    tarjeta4.pagarboleto(centros,datetime.strptime("25/01/2015 18:26", "%d/%m/%Y %H:%M"))
    tarjeta4.pagarboleto(centro,datetime.strptime("25/01/2015 18:40", "%d/%m/%Y %H:%M"))
    assert(tarjeta4.mostrarsaldo()==6.14)
    #caso diferente linea
    tarjeta5=EMR.comun(0,1,0,datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"),0)
    tarjeta5.recarga(20)
    tarjeta6=EMR.medio(0,144,0,datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"),0)
    tarjeta6.recarga(10)
    tarjeta5.pagarboleto(k,datetime.strptime("25/01/2015 18:40", "%d/%m/%Y %H:%M"))
    tarjeta5.pagarboleto(centros,datetime.strptime("25/01/2015 18:55", "%d/%m/%Y %H:%M"))
    assert(tarjeta5.mostrarsaldo()==12.35)
    tarjeta6.pagarboleto(k,datetime.strptime("25/01/2015 18:26", "%d/%m/%Y %H:%M"))
    tarjeta6.pagarboleto(centro,datetime.strptime("25/01/2015 18:40", "%d/%m/%Y %H:%M"))
    assert(tarjeta6.mostrarsaldo()==6.14)
예제 #5
0
파일: test.py 프로젝트: Fela182/EMR
def test_pagarBoleto():
    tarjeta1=EMR.comun(0,1,0,datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"),0)
    tarjeta1.recarga(20)
    tarjeta2=EMR.medio(0,144,0,datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"),0)
    tarjeta2.recarga(10)
    #que pague colectivo
    assert(tarjeta1.pagarboleto(k,datetime.strptime("25/01/2015 18:10", "%d/%m/%Y %H:%M")))
    assert(tarjeta2.pagarboleto(centro,datetime.strptime("25/01/2015 18:10", "%d/%m/%Y %H:%M")))
    
   
    #que pague dos boletos seguidos del mismo colectivo con el mismo interno
    
    tarjeta1.pagarboleto(k,datetime.strptime("25/01/2015 18:40", "%d/%m/%Y %H:%M"))
    assert(tarjeta1.mostrarsaldo()==8.50)
    tarjeta2.pagarboleto(centro,datetime.strptime("25/01/2015 18:26", "%d/%m/%Y %H:%M"))
    assert(tarjeta2.mostrarsaldo()==4.20)
예제 #6
0
def test_pagarBoleto():
    tarjeta1 = EMR.comun(
        0, 1, 0, datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"), 0)
    tarjeta1.recarga(20)
    tarjeta2 = EMR.medio(
        0, 144, 0, datetime.strptime("25/01/2015 15:05", "%d/%m/%Y %H:%M"), 0)
    tarjeta2.recarga(10)
    #que pague colectivo
    assert (tarjeta1.pagarboleto(
        k, datetime.strptime("25/01/2015 18:10", "%d/%m/%Y %H:%M")))
    assert (tarjeta2.pagarboleto(
        centro, datetime.strptime("25/01/2015 18:10", "%d/%m/%Y %H:%M")))

    #que pague dos boletos seguidos del mismo colectivo con el mismo interno

    tarjeta1.pagarboleto(
        k, datetime.strptime("25/01/2015 18:40", "%d/%m/%Y %H:%M"))
    assert (tarjeta1.mostrarsaldo() == 8.50)
    tarjeta2.pagarboleto(
        centro, datetime.strptime("25/01/2015 18:26", "%d/%m/%Y %H:%M"))
    assert (tarjeta2.mostrarsaldo() == 4.20)