Skip to content
This repository has been archived by the owner on May 24, 2018. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/cds-1846-build-user-table' into …
Browse files Browse the repository at this point in the history
…test/staging
  • Loading branch information
Mowinski committed Mar 29, 2018
2 parents 0d4e531 + 7ce8e00 commit e6b4991
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions master/buildbot/test/fake/fakedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,13 @@ def identifierToUid(self, identifier):
return defer.succeed(uid)
return defer.succeed(None)

def getUidByLdapUsername(self, username):
for uid in self.users:
if self.users[uid]['identifier'].startswith(username):
return defer.succeed(uid)
return defer.succeed(None)


class FakeDBConnector(object):
"""
A stand-in for C{master.db} that operates without an actual database
Expand Down
4 changes: 3 additions & 1 deletion master/buildbot/test/unit/test_status_builder_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
from buildbot.test.fake import fakemaster
from buildbot.test.fake.fakedb import FakeBuildsComponent, FakeUsersComponent, User


class FakeDBConnector():
def __init__(self):
self.builds = FakeBuildsComponent(self, [])
self.users = FakeUsersComponent(self, [User(uid=1, identifier='soap'),])
self.users = FakeUsersComponent(self, "test_status_builder_cache")
self.users.insertTestData([User(uid=1, identifier='soap')])


class TestBuildStatus(unittest.TestCase):
Expand Down

0 comments on commit e6b4991

Please sign in to comment.