Exemplo n.º 1
0
def createStore(testCase):
    dbpath = testCase.mktemp()
    axiomatic.main(['-d', dbpath, 'mantissa', '--admin-password', 'password'])

    store = Store(dbpath)

    _userbase = store.findUnique(userbase.LoginSystem)
    adminAccount = _userbase.accountByAddress(u'admin', u'localhost')
    adminStore = adminAccount.avatars.open()

    conf = adminStore.findUnique(offering.OfferingConfiguration)
    conf.installOffering(getQuotientOffering(), None)
    return store
Exemplo n.º 2
0
    def userbase(self, *args):
        """
        Run 'axiomatic userbase' with the given arguments on database at
        C{dbdir}.

        @return: A list of lines printed to stdout by the axiomatic command.
        """
        output = io.StringIO()
        sys.stdout, stdout = output, sys.stdout
        try:
            axiomatic.main(['-d', self.dbdir.path, 'userbase'] + list(args))
        finally:
            sys.stdout = stdout
        return output.getvalue().splitlines()