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

Fix count votes integ test #1733

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions tests_new/integration_tests/modules/vote/test_vote.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,5 @@ def test_count_upvote_invalid(client1, vote1, session_s3_dataset1):
)


def test_count_votes(client2, vote1, session_s3_dataset1):
count = count_upvotes(client2, session_s3_dataset1.datasetUri, S3_DATASET_TARGET_TYPE)

# Assert incremeent by 1
upvote(client2, session_s3_dataset1.datasetUri, S3_DATASET_TARGET_TYPE, True)
assert_that(count_upvotes(client2, session_s3_dataset1.datasetUri, S3_DATASET_TARGET_TYPE)).is_equal_to(count + 1)

# Assert decrement by 1
upvote(client2, session_s3_dataset1.datasetUri, S3_DATASET_TARGET_TYPE, False)
assert_that(count_upvotes(client2, session_s3_dataset1.datasetUri, S3_DATASET_TARGET_TYPE)).is_equal_to(count)
def test_count_votes(client1, vote1, session_s3_dataset1):
assert_that(count_upvotes(client1, session_s3_dataset1.datasetUri, S3_DATASET_TARGET_TYPE)).is_equal_to(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we also need a test, that for client2 in fails due to lack of permissions?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we cover a lot of those unauth tests in the functional tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No because count is public, there are no restrictions on who can count the votes

Loading