Skip to content

Commit

Permalink
resolved change requests
Browse files Browse the repository at this point in the history
  • Loading branch information
umar8hassan committed May 30, 2024
1 parent fe70f63 commit 39b96c4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion videos/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
WEBVTT_FORMAT_ID = 51

TRANSCODE_JOB_SUBSCRIPTION_URL = "https://sns.{AWS_REGION}.amazonaws.com/?Action=ConfirmSubscription&TopicArn=arn:aws:sns:{AWS_REGION}:{AWS_ACCOUNT_ID}:MediaConvertJobAlert&Token={TOKEN}"
BAD_REQUEST_MSG = "Token Cannot be empty!"
BAD_REQUEST_MSG = "Token cannot be empty!"


class VideoStatus:
Expand Down
2 changes: 1 addition & 1 deletion videos/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class BadRequest(APIException):
"""Exception for Invalid request data"""
"""Exception for invalid request data"""

status_code = status.HTTP_400_BAD_REQUEST
default_detail = "Bad request."
Expand Down
2 changes: 1 addition & 1 deletion videos/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_create_new_content(mocker):


def test_get_subscribe_url(mocker):
"""Test for get_subscribe_url method"""
"""Test get_subscribe_url to format ConfirmSubscription url correctly"""

mocker.patch("django.conf.settings.AWS_REGION", "us-east-1")
mocker.patch("django.conf.settings.AWS_ACCOUNT_ID", "1234567890")
Expand Down
5 changes: 3 additions & 2 deletions videos/views_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest
from django.http.response import HttpResponse
from django.urls import reverse
from rest_framework.status import HTTP_400_BAD_REQUEST

from gdrive_sync.factories import DriveFileFactory
from users.factories import UserFactory
Expand Down Expand Up @@ -102,7 +103,7 @@ def test_transcode_jobs_wrong_account(drf_client):


def test_transcode_jobs_subscribe(settings, mocker, drf_client):
"""TranscodeJobView should confirm a subcsription request"""
"""TranscodeJobView should confirm a subscription request"""
mock_get = mocker.patch("videos.views.requests.get")
with open( # noqa: PTH123
f"{TEST_VIDEOS_WEBHOOK_PATH}/subscribe.json", encoding="utf-8"
Expand Down Expand Up @@ -149,7 +150,7 @@ def test_transcode_jobs_subscribe_bad_request(settings, mocker, drf_client):
data["Token"] = ""

response = drf_client.post(reverse("transcode_jobs"), data=data)
assert response.status_code == 400
assert response.status_code == HTTP_400_BAD_REQUEST
mock_get.assert_not_called()


Expand Down

0 comments on commit 39b96c4

Please sign in to comment.