Revert "Remove old search API which is no longer in use"
This commit is contained in:
parent
e441a58a8d
commit
fe2cd240bc
5 changed files with 160 additions and 5 deletions
|
@ -24,7 +24,7 @@ from data.database import RepositoryActionCount
|
|||
|
||||
from endpoints.api.team import TeamMember, TeamMemberList, TeamMemberInvite, OrganizationTeam
|
||||
from endpoints.api.tag import RepositoryTagImages, RepositoryTag, RevertTag, ListRepositoryTags
|
||||
from endpoints.api.search import ConductSearch
|
||||
from endpoints.api.search import EntitySearch, ConductSearch
|
||||
from endpoints.api.image import RepositoryImage, RepositoryImageList
|
||||
from endpoints.api.build import RepositoryBuildStatus, RepositoryBuildList, RepositoryBuildResource
|
||||
from endpoints.api.robot import (UserRobotList, OrgRobot, OrgRobotList, UserRobot,
|
||||
|
@ -668,6 +668,40 @@ class TestConductSearch(ApiTestCase):
|
|||
|
||||
|
||||
|
||||
class TestGetMatchingEntities(ApiTestCase):
|
||||
def test_notinorg(self):
|
||||
self.login(NO_ACCESS_USER)
|
||||
|
||||
json = self.getJsonResponse(EntitySearch,
|
||||
params=dict(prefix='o', namespace=ORGANIZATION,
|
||||
includeTeams='true'))
|
||||
|
||||
names = set([r['name'] for r in json['results']])
|
||||
assert 'outsideorg' in names
|
||||
assert not 'owners' in names
|
||||
|
||||
def test_inorg(self):
|
||||
self.login(ADMIN_ACCESS_USER)
|
||||
|
||||
json = self.getJsonResponse(EntitySearch,
|
||||
params=dict(prefix='o', namespace=ORGANIZATION,
|
||||
includeTeams='true'))
|
||||
|
||||
names = set([r['name'] for r in json['results']])
|
||||
assert 'outsideorg' in names
|
||||
assert 'owners' in names
|
||||
|
||||
def test_inorg_withorgs(self):
|
||||
self.login(ADMIN_ACCESS_USER)
|
||||
|
||||
json = self.getJsonResponse(EntitySearch,
|
||||
params=dict(prefix=ORGANIZATION[0], namespace=ORGANIZATION,
|
||||
includeOrgs='true'))
|
||||
|
||||
names = set([r['name'] for r in json['results']])
|
||||
assert ORGANIZATION in names
|
||||
|
||||
|
||||
class TestCreateOrganization(ApiTestCase):
|
||||
def test_existinguser(self):
|
||||
self.login(ADMIN_ACCESS_USER)
|
||||
|
|
Reference in a new issue