Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kinesisvideo #3271

Merged
merged 17 commits into from Sep 2, 2020
Merged

Add kinesisvideo #3271

merged 17 commits into from Sep 2, 2020

Conversation

toshitanian
Copy link
Contributor

@toshitanian toshitanian commented Aug 30, 2020

Added basic operations of kinesisvideo

  • create_stream
  • describe_stream
  • list_streams
  • delete_stream
  • get_data_endpoint

@toshitanian toshitanian marked this pull request as draft August 30, 2020 11:47
@toshitanian toshitanian marked this pull request as ready for review August 30, 2020 12:07
@coveralls
Copy link

coveralls commented Aug 30, 2020

Coverage Status

Coverage decreased (-0.01%) to 94.392% when pulling 937dd23 on toshitanian:add_kinesisvideo into 0a89f9d on spulec:master.

@toshitanian toshitanian marked this pull request as draft August 30, 2020 14:43
@toshitanian toshitanian marked this pull request as ready for review August 31, 2020 14:18
@toshitanian
Copy link
Contributor Author

@bblommers please check when you have time 🙏

Copy link
Collaborator

@bblommers bblommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @toshitanian, thanks for your PR! Left a few comments

self.status = "ACTIVE"
self.version = self._get_random_string()
self.creation_time = datetime.utcnow()
stream_arn = "arn:aws:kinesisvideo:{}:123456789012:stream/{}/1598784211076".format(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this is the account ID? Let's import that from moto.core, to avoid magic numbers as much as possible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

):
streams = [_ for _ in self.streams.values() if _.stream_name == stream_name]
if len(streams) > 0:
raise ResourceInUseException("The stream a already exists.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo - or should it say The stream {stream_name} already exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding out. updated.
6384f37



@mock_kinesisvideo
def test_list():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we split this test up? I prefer to have smaller test cases, i.e. test_list, test_create, test_create_with_same_name, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done: 937dd23

def test_kinesisvideo_list():
backend = server.create_backend_app("kinesisvideo")
test_client = backend.test_client()
# do test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test necessary, if it's already covered by the boto3 test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to have test for moto_server. I added assert of response code to make sure that the server is up.
a7b46c6

@toshitanian
Copy link
Contributor Author

@bblommers changed for reviews.

Copy link
Collaborator

@bblommers bblommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @toshitanian!

@bblommers bblommers merged commit 25161c0 into getmoto:master Sep 2, 2020
@bblommers
Copy link
Collaborator

This is now part of moto >= 1.3.15.dev1042

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants