Skip to content

Commit

Permalink
Corrected eq import and few tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ketan Arlulkar <6256964+ketanarlulkar@users.noreply.github.com>
  • Loading branch information
ketanarlulkar committed May 27, 2022
1 parent 17c3a85 commit 6515ec6
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions s3tests_boto3/functional/test_iam.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import json
from operator import eq

from botocore.exceptions import ClientError
from nose.plugins.attrib import attr
from nose.tools import eq_ as eq

from s3tests.functional.utils import assert_raises
from . import get_tenant_iam_client, get_tenant_user_id
Expand Down Expand Up @@ -67,7 +67,7 @@ def test_put_user_policy_parameter_limit():
}
)
e = assert_raises(ClientError, client.put_user_policy, PolicyDocument=policy_document,
PolicyName='AllAccessPolicy' * 10, UserName="some-non-existing-user-id")
PolicyName='AllAccessPolicy' * 10, UserName=get_tenant_user_id())
status = _get_status(e.response)
eq(status, 400)

Expand All @@ -90,7 +90,7 @@ def test_put_user_policy_invalid_element():
}
)
e = assert_raises(ClientError, client.put_user_policy, PolicyDocument=policy_document,
PolicyName='AllAccessPolicy', UserName="some-non-existing-user-id")
PolicyName='AllAccessPolicy', UserName=get_tenant_user_id())
status = _get_status(e.response)
eq(status, 400)

Expand All @@ -101,7 +101,7 @@ def test_put_user_policy_invalid_element():
}
)
e = assert_raises(ClientError, client.put_user_policy, PolicyDocument=policy_document,
PolicyName='AllAccessPolicy', UserName="some-non-existing-user-id")
PolicyName='AllAccessPolicy', UserName=get_tenant_user_id())
status = _get_status(e.response)
eq(status, 400)

Expand All @@ -120,7 +120,7 @@ def test_put_user_policy_invalid_element():
}
)
e = assert_raises(ClientError, client.put_user_policy, PolicyDocument=policy_document,
PolicyName='AllAccessPolicy', UserName="some-non-existing-user-id")
PolicyName='AllAccessPolicy', UserName=get_tenant_user_id())
status = _get_status(e.response)
eq(status, 400)

Expand All @@ -135,7 +135,7 @@ def test_put_user_policy_invalid_element():
}
)
e = assert_raises(ClientError, client.put_user_policy, PolicyDocument=policy_document,
PolicyName='AllAccessPolicy', UserName="some-non-existing-user-id")
PolicyName='AllAccessPolicy', UserName=get_tenant_user_id())
status = _get_status(e.response)
eq(status, 400)

Expand Down Expand Up @@ -335,10 +335,6 @@ def test_delete_user_policy():
client.put_user_policy(PolicyDocument=policy_document_allow, PolicyName='AllowAccessPolicy',
UserName=get_tenant_user_id())
client.delete_user_policy(PolicyName='AllowAccessPolicy', UserName=get_tenant_user_id())
e = assert_raises(ClientError, client.get_user_policy, PolicyName='AllAccessPolicy',
UserName=get_tenant_user_id())
status = _get_status(e.response)
eq(status, 404)


@attr(resource='user-policy')
Expand Down

0 comments on commit 6515ec6

Please sign in to comment.