コード例 #1
0
    def testUserBaseInstall(self):
        dbdir = self.mktemp()
        axiomatic.main(['-d', dbdir, 'userbase', 'install'])

        s = Store(dbdir)
        IRealm(s)
        ICredentialsChecker(s)
        s.close()
コード例 #2
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
コード例 #3
0
ファイル: test_signup.py プロジェクト: pombredanne/quotient
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
コード例 #4
0
ファイル: test_userbase.py プロジェクト: perkinslr/axiom-py3
    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()
コード例 #5
0
    def testUserCreation(self):
        dbdir = self.mktemp()
        axiomatic.main(
            ['-d', dbdir, 'userbase', 'create', 'alice', 'localhost', SECRET])

        s = Store(dbdir)
        cc = ICredentialsChecker(s)
        p = Portal(IRealm(s), [cc])

        def cb((interface, avatar, logout)):
            logout()

        return p.login(UsernamePassword('alice@localhost', SECRET), None,
                       lambda orig, default: orig).addCallback(cb)