-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from ARGOeu/devel
Prepare for v0.61
- Loading branch information
Showing
4 changed files
with
65 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
Name: argo-ams-library | ||
Summary: %{sum} | ||
Version: 0.6.0 | ||
Version: 0.6.1 | ||
Release: 1%{?dist} | ||
|
||
Group: Development/Libraries | ||
|
@@ -73,6 +73,8 @@ rm -rf %{buildroot} | |
|
||
|
||
%changelog | ||
* Mon Feb 6 2023 agelostsal <[email protected]> - 0.6.1-1%{?dist} | ||
- AM-314 Add projects:createUser functionality to ams library | ||
* Thu Nov 3 2022 Daniel Vrcic <[email protected]>, agelostsal <[email protected]> - 0.6.0-1%{?dist} | ||
- AM-143 Add support for requests ReadTimeOut exception | ||
- AM-228 Add user management fuctionality to AMS-library | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,10 @@ def setUp(self): | |
path="/v1/projects/test-proj/members/test-member", | ||
method='GET') | ||
|
||
create_member_urlmatch = dict(netloc="localhost", | ||
path="/v1/projects/test-proj/members/test-member", | ||
method='POST') | ||
|
||
remove_member_urlmatch = dict(netloc="localhost", | ||
path="/v1/projects/test-proj/members/test-member:remove", | ||
method='POST') | ||
|
@@ -94,21 +98,24 @@ def add_member_mock(url, request): | |
self.assertEqual(self.default_user.projects[0].subscriptions, added_member.projects[0].subscriptions) | ||
self.assertEqual(self.default_user.projects[0].topics, added_member.projects[0].topics) | ||
|
||
def testGetMember(self): | ||
@urlmatch(**self.get_member_urlmatch) | ||
def get_member_mock(url, request): | ||
def testCreateMember(self): | ||
@urlmatch(**self.create_member_urlmatch) | ||
def create_member_mock(url, request): | ||
self.assertEqual("/v1/projects/test-proj/members/test-member", url.path) | ||
self.assertEqual("GET", request.method) | ||
self.assertEqual("POST", request.method) | ||
return response(200, self.member_json, None, None, 5, request) | ||
|
||
# Execute ams client with mocked response | ||
with HTTMock(get_member_mock): | ||
added_member = self.ams.get_project_member(project="test-proj", username="test-member") | ||
with HTTMock(create_member_mock): | ||
created_member = self.ams.create_project_member(project="test-proj", | ||
username="test-member", | ||
email="[email protected]") | ||
# test case where the global service project is used | ||
added_member_with_service_project = self.ams.get_project_member(username="test-member") | ||
added_members = [added_member, added_member_with_service_project] | ||
created_member_with_service_project = self.ams.create_project_member(username="test-member", | ||
email="[email protected]") | ||
created_members = [created_member, created_member_with_service_project] | ||
|
||
for added_member in added_members: | ||
for added_member in created_members: | ||
self.assertEqual(self.default_user.name, added_member.name) | ||
self.assertEqual(self.default_user.email, added_member.email) | ||
self.assertEqual(self.default_user.uuid, added_member.uuid) | ||
|
@@ -150,7 +157,7 @@ def create_project_mock(url, request): | |
r = self.ams.create_project(name="test-project", description="nice project") | ||
self.assertEqual("test-project", r["project"]) | ||
self.assertEqual("nice project", r["description"]) | ||
|
||
def testUpdateProject(self): | ||
@urlmatch(**self.update_project_urlmatch) | ||
def update_project_mock(url, request): | ||
|