-
Notifications
You must be signed in to change notification settings - Fork 322
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
Convert some tests to pytest #1693
Open
ZeyadTarekk
wants to merge
8
commits into
facebook:main
Choose a base branch
from
ZeyadTarekk:convert_some_tests_to_pytest
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+190
−183
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a45f986
change test_hash_from_x
ZeyadTarekk 890ac4b
change test_md5_hash
ZeyadTarekk a4ccca2
change test_raw_text
ZeyadTarekk 485f8f7
change test_url_md5_hash
ZeyadTarekk e71df22
change test_pdq_index
ZeyadTarekk 29c27d4
Fix formatting
ZeyadTarekk f303965
Update pdf test
ZeyadTarekk be67fa4
fix test raw text
ZeyadTarekk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
change test_url_md5_hash
commit 485f8f7d02284f65cb888d93f6db8880f2b59075
There are no files selected for viewing
17 changes: 5 additions & 12 deletions
17
python-threatexchange/threatexchange/signal_type/tests/test_url_md5_hash.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
|
||
import unittest | ||
|
||
import pytest | ||
from threatexchange.signal_type.url_md5 import UrlMD5Signal | ||
|
||
URL_TEST = "www.facebook.com/?user=123" | ||
FULL_URL_TEST = "https://www.facebook.com/?user=123" | ||
URL_TEST_MD5 = "e359430911fe80c2dd526d3cca21da30" | ||
|
||
def test_can_hash_simple_url(): | ||
assert UrlMD5Signal.hash_from_str(URL_TEST) == URL_TEST_MD5, "MD5 hash does not match" | ||
|
||
class UrlMD5SignalTestCase(unittest.TestCase): | ||
def test_can_hash_simple_url(self): | ||
assert URL_TEST_MD5 == UrlMD5Signal.hash_from_str( | ||
URL_TEST | ||
), "MD5 hash does not match" | ||
|
||
def test_can_hash_full_url(self): | ||
assert URL_TEST_MD5 == UrlMD5Signal.hash_from_str( | ||
FULL_URL_TEST | ||
), "MD5 hash does not match" | ||
def test_can_hash_full_url(): | ||
assert UrlMD5Signal.hash_from_str(FULL_URL_TEST) == URL_TEST_MD5, "MD5 hash does not match" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: The existing asset comments don't seem to add much, but I think it's fine to ignore |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file looks good