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 test for content type header #4345

Merged
merged 5 commits into from
Feb 17, 2022
Merged

Add test for content type header #4345

merged 5 commits into from
Feb 17, 2022

Conversation

Marishka17
Copy link
Contributor

Motivation and context

How has this been tested?

Checklist

  • I submit my changes into the develop branch
    - [ ] I have added a description of my changes into CHANGELOG file
    - [ ] I have updated the documentation accordingly
  • I have added tests to cover my changes
    - [ ] I have linked related issues (read github docs)
    - [ ] I have increased versions of npm packages if it is necessary (cvat-canvas,
    cvat-core, cvat-data and cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
    - [ ] I have updated the license header for each file (see an example below)
# Copyright (C) 2022 Intel Corporation
#
# SPDX-License-Identifier: MIT

@Marishka17 Marishka17 requested a review from nmanovic February 15, 2022 12:10
@nmanovic
Copy link
Contributor

@Marishka17 , could we extend https://github.com/openvinotoolkit/cvat/tree/develop/tests/rest_api? I really don't want to touch old tests anymore if they are working.

@Marishka17 Marishka17 requested a review from azhavoro as a code owner February 16, 2022 06:58
nmanovic
nmanovic previously approved these changes Feb 16, 2022
Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

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

@Marishka17 , LGTM. I would rename test_data.py to test_tasks.py (or test_0010_tasks.py if we decide to keep numbers in the file name).

@nmanovic
Copy link
Contributor

@kirill-sizov , please look and advise.

Copy link
Contributor

@sizov-kirill sizov-kirill left a comment

Choose a reason for hiding this comment

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

We try to avoid using hardcoded data (usernames, ids, etc.) in tests.
But even though this test assumes that tasks with ids 1, 5, 6 will never change Content-Type and that user1 will always see them, I think this is a reasonable limitation because it is difficult to change this information (except for example by deleting a task).

For sure it's easy to avoid this limitation with creating another one JSON file headers.json, but I suggest to delay this idea till it will be really needed.

Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

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

LGTM

@nmanovic nmanovic merged commit 9950118 into develop Feb 17, 2022
@nmanovic nmanovic deleted the mk/test_content_type branch February 17, 2022 19:22
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.

3 participants