Skip to content

Commit

Permalink
Fix bug in creating app role (#778)
Browse files Browse the repository at this point in the history
* Fix bug in creating app role

* Fix tests
  • Loading branch information
andyhd authored Nov 19, 2019
1 parent 8539a2f commit f15cf72
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controlpanel/api/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def iam_role_name(self):
return f"{settings.ENV}_app_{self.app.slug}"

def create_iam_role(self):
aws.create_app_role(self.iam_role_name)
aws.create_app_role(self.app)

def delete_iam_role(self):
aws.delete_role(self.iam_role_name)
Expand Down
2 changes: 1 addition & 1 deletion tests/api/cluster/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def app():

def test_app_create_iam_role(aws, app):
cluster.App(app).create_iam_role()
aws.create_app_role.assert_called_with(app.iam_role_name)
aws.create_app_role.assert_called_with(app)


def test_app_delete_iam_role(aws, app):
Expand Down
2 changes: 1 addition & 1 deletion tests/api/models/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_slug_collisions_increments():
@pytest.mark.django_db
def test_aws_create_role_calls_service(aws):
app = App.objects.create(repo_url="https://example.com/repo_name")
aws.create_app_role.assert_called_with(app.iam_role_name)
aws.create_app_role.assert_called_with(app)


@pytest.mark.django_db
Expand Down

0 comments on commit f15cf72

Please sign in to comment.