diff options
author | 2017-11-19 11:42:55 +0200 | |
---|---|---|
committer | 2017-11-19 11:43:15 +0200 | |
commit | a9ef6f094a2bcf1fd7a0b7c2aaf814841db558ec (patch) | |
tree | 81a3f8436f9e6af07c3070c74f3a0543c2ca5eff /django/engagementmanager/tests/test_remove_user_from_eng_team.py | |
parent | c169d08d437ccb62fd79ade759077b874f00b1c3 (diff) |
Pep8 more fixes
Update base files to pass pep8 strict standarts.
Issue-ID: VVP-25
Change-Id: If9ef80abf7fbc33ea181dfc2eb73c27ddd6ddc3e
Signed-off-by: Edan Binshtok <eb578m@intl.att.com>
Diffstat (limited to 'django/engagementmanager/tests/test_remove_user_from_eng_team.py')
-rw-r--r-- | django/engagementmanager/tests/test_remove_user_from_eng_team.py | 169 |
1 files changed, 117 insertions, 52 deletions
diff --git a/django/engagementmanager/tests/test_remove_user_from_eng_team.py b/django/engagementmanager/tests/test_remove_user_from_eng_team.py index 15bcf2d..0c45ccb 100644 --- a/django/engagementmanager/tests/test_remove_user_from_eng_team.py +++ b/django/engagementmanager/tests/test_remove_user_from_eng_team.py @@ -1,5 +1,5 @@ -# -# ============LICENSE_START========================================== +# +# ============LICENSE_START========================================== # org.onap.vvp/engagementmgr # =================================================================== # Copyright © 2017 AT&T Intellectual Property. All rights reserved. @@ -50,49 +50,81 @@ class TestEngagementSetStage(TestBaseEntity): def childSetup(self): - self.createVendors([Constants.service_provider_company_name, 'Amdocs']) + self.createVendors([Constants.service_provider_company_name, + 'Amdocs']) self.vendor = Vendor.objects.get(name='Amdocs') - self.service_provider = Vendor.objects.get(name=Constants.service_provider_company_name) + self.service_provider = Vendor.objects.get( + name=Constants.service_provider_company_name) self.createDefaultRoles() # For negative tests - self.user = self.creator.createUser(Vendor.objects.get( - name=Constants.service_provider_company_name), self.randomGenerator("main-vendor-email"), - '55501000199', 'user', self.standard_user, True) - self.user2 = self.creator.createUser(Vendor.objects.get( - name=Constants.service_provider_company_name), self.randomGenerator("main-vendor-email"), - '55501000199', 'user2', self.standard_user, True) + self.user = self.creator.createUser( + Vendor.objects.get( + name=Constants.service_provider_company_name), + self.randomGenerator("main-vendor-email"), + '55501000199', + 'user', + self.standard_user, + True) + self.user2 = self.creator.createUser( + Vendor.objects.get( + name=Constants.service_provider_company_name), + self.randomGenerator("main-vendor-email"), + '55501000199', + 'user2', + self.standard_user, + True) # Create users with role el (el+peer reviwer) - self.el_user = self.creator.createUser(Vendor.objects.get( - name=Constants.service_provider_company_name), self.randomGenerator("main-vendor-email"), - '55501000199', 'el user', self.el, True) - self.peer_reviewer = self.creator.createUser(self.service_provider, self.randomGenerator( - "main-vendor-email"), self.randomGenerator("randomNumber"), self.randomGenerator("randomString"), self.el, True) + self.el_user = self.creator.createUser( + Vendor.objects.get( + name=Constants.service_provider_company_name), + self.randomGenerator("main-vendor-email"), + '55501000199', + 'el user', + self.el, + True) + self.peer_reviewer = self.creator.createUser( + self.service_provider, + self.randomGenerator("main-vendor-email"), + self.randomGenerator("randomNumber"), + self.randomGenerator("randomString"), + self.el, + True) # Create a user with admin role - self.admin_user = self.creator.createUser(Vendor.objects.get( - name=Constants.service_provider_company_name), Constants.service_provider_admin_mail, - '55501000199', 'admin user', self.admin, True) + self.admin_user = self.creator.createUser( + Vendor.objects.get( + name=Constants.service_provider_company_name), + Constants.service_provider_admin_mail, + '55501000199', + 'admin user', + self.admin, + True) - self.engagement = self.creator.createEngagement('just-a-fake-uuid', 'Validation', None) + self.engagement = self.creator.createEngagement( + 'just-a-fake-uuid', 'Validation', None) self.engagement.reviewer = self.el_user self.engagement.peer_reviewer = self.peer_reviewer - self.engagement.engagement_team.add(self.el_user, self.user, self.user2) + self.engagement.engagement_team.add( + self.el_user, self.user, self.user2) self.engagement.save() self.deploymentTarget = self.creator.createDeploymentTarget( - self.randomGenerator("randomString"), self.randomGenerator("randomString")) -# self.asInfrastructure = self.creator.createApplicationServiceInfrastructure(self.randomGenerator("randomString")) - self.vf = self.creator.createVF(self.randomGenerator("randomString"), - self.engagement, self.deploymentTarget, False, self.vendor) -# self.vf.service_infrastructures.add(self.asInfrastructure) + self.randomGenerator("randomString"), + self.randomGenerator("randomString")) + self.vf = self.creator.createVF( + self.randomGenerator("randomString"), + self.engagement, + self.deploymentTarget, + False, + self.vendor) self.data = dict() self.user_token = self.loginAndCreateSessionToken(self.user) self.user2_token = self.loginAndCreateSessionToken(self.user2) self.admin_token = self.loginAndCreateSessionToken(self.admin_user) - def loggerTestFailedOrSucceded(self, bool): - if bool: + def loggerTestFailedOrSucceded(self, bool_flag): + if bool_flag: logger.debug("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$") logger.debug(" Test Succeeded") logger.debug("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n\n") @@ -106,23 +138,32 @@ class TestEngagementSetStage(TestBaseEntity): logger.debug(" Test 2 started: Admin removes user from the eng team!") logger.debug("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n\n") - self.get_engagement_url = self.urlPrefix + "single-engagement/" + str(self.engagement.uuid) + self.get_engagement_url = self.urlPrefix + \ + "single-engagement/" + str(self.engagement.uuid) self.urlStr = self.urlPrefix + "engagements/engagement-team/" self.data['eng_uuid'] = str(self.engagement.uuid) self.data['user_uuid'] = str(self.user.uuid) datajson = json.dumps(self.data, ensure_ascii=False) - logger.debug("**********************************************************************") + logger.debug( + "**************************************************") logger.debug("----- sending put request with body -----") - logger.debug("**********************************************************************") + logger.debug( + "**************************************************") - response = self.c.put(self.urlStr, datajson, content_type='application/json', - **{'HTTP_AUTHORIZATION': "token " + self.admin_token}) + response = self.c.put(self.urlStr, + datajson, + content_type='application/json', + **{'HTTP_AUTHORIZATION': "token " + + self.admin_token}) if (response.status_code != HTTP_204_NO_CONTENT): print(response.status_code) - response2 = self.c.get(self.get_engagement_url, {}, content_type='application/json', - **{'HTTP_AUTHORIZATION': "token " + self.admin_token}) + response2 = self.c.get(self.get_engagement_url, + {}, + content_type='application/json', + **{'HTTP_AUTHORIZATION': "token " + + self.admin_token}) # Check if the user it still in the engagement team received_eng = json.loads(response2.content) @@ -139,28 +180,40 @@ class TestEngagementSetStage(TestBaseEntity): def test_negative_remove_user_from_eng_team_by_another_user(self): logger.debug("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$") - logger.debug(" Test 3 (Negative) started: User2 removes user1 from the eng team!") + logger.debug( + " Test 3 (Negative) started: User2 removes \ + user1 from the eng team!") logger.debug("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n\n") - self.get_engagement_url = self.urlPrefix + "single-engagement/" + str(self.engagement.uuid) + self.get_engagement_url = self.urlPrefix + \ + "single-engagement/" + str(self.engagement.uuid) self.urlStr = self.urlPrefix + "engagements/engagement-team/" self.data['eng_uuid'] = str(self.engagement.uuid) self.data['user_uuid'] = str(self.user.uuid) datajson = json.dumps(self.data, ensure_ascii=False) - logger.debug("**********************************************************************") + logger.debug( + "**************************************************") logger.debug("----- sending put request with body -----") - logger.debug("**********************************************************************") + logger.debug( + "**************************************************") - response = self.c.put(self.urlStr, datajson, content_type='application/json', - **{'HTTP_AUTHORIZATION': "token " + self.user2_token}) + response = self.c.put(self.urlStr, + datajson, + content_type='application/json', + **{'HTTP_AUTHORIZATION': "token " + + self.user2_token}) if (response.status_code != HTTP_204_NO_CONTENT): print(response.status_code) - response2 = self.c.get(self.get_engagement_url, {}, content_type='application/json', - **{'HTTP_AUTHORIZATION': "token " + self.admin_token}) + response2 = self.c.get(self.get_engagement_url, + {}, + content_type='application/json', + **{'HTTP_AUTHORIZATION': "token " + + self.admin_token}) - # Check if the user it still in the engagement team(it is supposed to remain there) + # Check if the user it still in the engagement team(it is supposed to + # remain there) received_eng = json.loads(response2.content) found = False for item in received_eng["engagement"]["engagement_team"]: @@ -175,28 +228,40 @@ class TestEngagementSetStage(TestBaseEntity): def test_negative_remove_el_user_from_eng_team_by_admin(self): logger.debug("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$") - logger.debug(" Test 4 (Negative) started: admin removes el_user from the eng team!") + logger.debug( + " Test 4 (Negative) started: admin removes \ + el_user from the eng team!") logger.debug("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n\n") - self.get_engagement_url = self.urlPrefix + "single-engagement/" + str(self.engagement.uuid) + self.get_engagement_url = self.urlPrefix + \ + "single-engagement/" + str(self.engagement.uuid) self.urlStr = self.urlPrefix + "engagements/engagement-team/" self.data['eng_uuid'] = str(self.engagement.uuid) self.data['user_uuid'] = str(self.el_user.uuid) datajson = json.dumps(self.data, ensure_ascii=False) - logger.debug("**********************************************************************") + logger.debug( + "**************************************************") logger.debug("----- sending put request with body -----") - logger.debug("**********************************************************************") + logger.debug( + "**************************************************") - response = self.c.put(self.urlStr, datajson, content_type='application/json', - **{'HTTP_AUTHORIZATION': "token " + self.admin_token}) + response = self.c.put(self.urlStr, + datajson, + content_type='application/json', + **{'HTTP_AUTHORIZATION': "token " + + self.admin_token}) if (response.status_code != HTTP_204_NO_CONTENT): print(response.status_code) - response2 = self.c.get(self.get_engagement_url, {}, content_type='application/json', - **{'HTTP_AUTHORIZATION': "token " + self.admin_token}) + response2 = self.c.get(self.get_engagement_url, + {}, + content_type='application/json', + **{'HTTP_AUTHORIZATION': "token " + + self.admin_token}) - # Check if the user it still in the engagement team(it is supposed to remain there) + # Check if the user it still in the engagement team(it is supposed to + # remain there) received_eng = json.loads(response2.content) found = False for item in received_eng["engagement"]["engagement_team"]: |