Esempio n. 1
0
    def setUp(self):
        db_pool = SQLiteMemoryDbPool()
        yield db_pool.prepare()

        hs = HomeServer(
            "test",
            db_pool=db_pool,
        )

        self.store = ProfileStore(hs)

        self.u_frank = hs.parse_userid("@frank:test")
Esempio n. 2
0
    def setUp(self):
        db_pool = SQLiteMemoryDbPool()
        yield db_pool.prepare()

        hs = HomeServer("test",
            db_pool=db_pool,
        )

        self.store = ProfileStore(hs)

        self.u_frank = hs.parse_userid("@frank:test")
Esempio n. 3
0
class ProfileStoreTestCase(unittest.TestCase):
    @defer.inlineCallbacks
    def setUp(self):
        hs = yield setup_test_homeserver(self.addCleanup)

        self.store = ProfileStore(None, hs)

        self.u_frank = UserID.from_string("@frank:test")

    @defer.inlineCallbacks
    def test_displayname(self):
        yield self.store.create_profile(self.u_frank.localpart)

        yield self.store.set_profile_displayname(self.u_frank.localpart,
                                                 "Frank")

        self.assertEquals(
            "Frank",
            (yield self.store.get_profile_displayname(self.u_frank.localpart)))

    @defer.inlineCallbacks
    def test_avatar_url(self):
        yield self.store.create_profile(self.u_frank.localpart)

        yield self.store.set_profile_avatar_url(self.u_frank.localpart,
                                                "http://my.site/here")

        self.assertEquals(
            "http://my.site/here",
            (yield self.store.get_profile_avatar_url(self.u_frank.localpart)),
        )
Esempio n. 4
0
class ProfileStoreTestCase(unittest.TestCase):
    @defer.inlineCallbacks
    def setUp(self):
        hs = yield setup_test_homeserver(self.addCleanup)

        self.store = ProfileStore(hs.get_db_conn(), hs)

        self.u_frank = UserID.from_string("@frank:test")

    @defer.inlineCallbacks
    def test_displayname(self):
        yield self.store.create_profile(self.u_frank.localpart)

        yield self.store.set_profile_displayname(self.u_frank.localpart, "Frank")

        self.assertEquals(
            "Frank", (yield self.store.get_profile_displayname(self.u_frank.localpart))
        )

    @defer.inlineCallbacks
    def test_avatar_url(self):
        yield self.store.create_profile(self.u_frank.localpart)

        yield self.store.set_profile_avatar_url(
            self.u_frank.localpart, "http://my.site/here"
        )

        self.assertEquals(
            "http://my.site/here",
            (yield self.store.get_profile_avatar_url(self.u_frank.localpart)),
        )
Esempio n. 5
0
class ProfileStoreTestCase(unittest.TestCase):

    @defer.inlineCallbacks
    def setUp(self):
        db_pool = SQLiteMemoryDbPool()
        yield db_pool.prepare()

        hs = HomeServer("test",
            db_pool=db_pool,
        )

        self.store = ProfileStore(hs)

        self.u_frank = hs.parse_userid("@frank:test")

    @defer.inlineCallbacks
    def test_displayname(self):
        yield self.store.create_profile(
            self.u_frank.localpart
        )

        yield self.store.set_profile_displayname(
            self.u_frank.localpart, "Frank"
        )

        self.assertEquals(
            "Frank",
            (yield self.store.get_profile_displayname(self.u_frank.localpart))
        )

    @defer.inlineCallbacks
    def test_avatar_url(self):
        yield self.store.create_profile(
            self.u_frank.localpart
        )

        yield self.store.set_profile_avatar_url(
                self.u_frank.localpart, "http://my.site/here"
        )

        self.assertEquals(
            "http://my.site/here",
            (yield self.store.get_profile_avatar_url(self.u_frank.localpart))
        )
Esempio n. 6
0
class ProfileStoreTestCase(unittest.TestCase):
    @defer.inlineCallbacks
    def setUp(self):
        db_pool = SQLiteMemoryDbPool()
        yield db_pool.prepare()

        hs = HomeServer(
            "test",
            db_pool=db_pool,
        )

        self.store = ProfileStore(hs)

        self.u_frank = hs.parse_userid("@frank:test")

    @defer.inlineCallbacks
    def test_displayname(self):
        yield self.store.create_profile(self.u_frank.localpart)

        yield self.store.set_profile_displayname(self.u_frank.localpart,
                                                 "Frank")

        self.assertEquals(
            "Frank",
            (yield self.store.get_profile_displayname(self.u_frank.localpart)))

    @defer.inlineCallbacks
    def test_avatar_url(self):
        yield self.store.create_profile(self.u_frank.localpart)

        yield self.store.set_profile_avatar_url(self.u_frank.localpart,
                                                "http://my.site/here")

        self.assertEquals(
            "http://my.site/here",
            (yield self.store.get_profile_avatar_url(self.u_frank.localpart)))
Esempio n. 7
0
    def setUp(self):
        hs = yield setup_test_homeserver()

        self.store = ProfileStore(hs)

        self.u_frank = UserID.from_string("@frank:test")
Esempio n. 8
0
    def setUp(self):
        hs = yield setup_test_homeserver(self.addCleanup)

        self.store = ProfileStore(None, hs)

        self.u_frank = UserID.from_string("@frank:test")
Esempio n. 9
0
    def setUp(self):
        hs = yield setup_test_homeserver(self.addCleanup)

        self.store = ProfileStore(hs.get_db_conn(), hs)

        self.u_frank = UserID.from_string("@frank:test")