Esempio n. 1
0
    def test_installOnReference(self):
        """
        Sets the C{donator} attribute to the L{Donator} that is passed
        in.
        """
        st = Store()
        d1 = Donation(store=st)
        donator = Donator(store=st, steamID=u'testingid')

        d1.installOn(donator)
        self.assertIdentical(donator, d1.donator)
Esempio n. 2
0
from bdm.donate import Donator

if '__main__' == __name__:
    parser = argparse.ArgumentParser(description='Process some integers.')
    parser.add_argument('--store',
                        metavar='<dir>',
                        type=str,
                        required=True,
                        help='An Axiom store directory')
    parser.add_argument('--steamid',
                        metavar='steamID',
                        type=int,
                        required=True,
                        help='64bit representation of a Steam ID.')
    parser.add_argument(
        '--anonymous',
        action='store_true',
        help='Use this flag if the user should be marked as anonymous.')
    args = parser.parse_args()

    store = Store(args.store)
    try:
        donator = store.findUnique(
            Donator, AND(Donator.steamID == unicode(args.steamid)))
    except ItemNotFound:
        donator = Donator(store=store,
                          steamID=unicode(args.steamid),
                          anonymous=args.anonymous)

    print donator
Esempio n. 3
0
 def setUp(self):
     self.store = Store()
     self.donator = Donator(store=self.store, steamID=u'testingid')