Exemplo n.º 1
0
    def test_payday(self, finish, loop, init, log):
        participants = mock.Mock()
        payday_start = mock.Mock()
        init.return_value = (participants, payday_start)
        greeting = 'Greetings, program! It\'s PAYDAY!!!!'

        billing.payday()

        self.assertTrue(log.called_with(greeting))
        self.assertTrue(init.call_count)
        self.assertTrue(loop.called_with(init.return_value))
        self.assertTrue(finish.call_count)
Exemplo n.º 2
0
def payday():
    wireup.db()
    wireup.billing()

    # Lazily import the billing module.
    # =================================
    # This dodges a problem where db in billing is None if we import it from
    # gittip before calling wire_samurai, and it also dodges:
    #
    #   https://github.com/FeeFighters/samurai-client-python/issues/8

    from gittip import billing

    try:
        billing.payday()
    except KeyboardInterrupt:
        pass
    except:
        import aspen
        import traceback

        aspen.log(traceback.format_exc())
Exemplo n.º 3
0
def payday():
    gittip.wire_db()
    gittip.wire_samurai()


    # Lazily import the billing module.
    # =================================
    # This dodges a problem where db in billing is None if we import it from 
    # gittip before calling wire_samurai, and it also dodges:
    #
    #   https://github.com/FeeFighters/samurai-client-python/issues/8

    from gittip import billing 

    try:
        billing.payday()
    except KeyboardInterrupt:
        pass
    except:
        import aspen
        import traceback
        aspen.log(traceback.format_exc())