-
Notifications
You must be signed in to change notification settings - Fork 67
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
CI Unit tests #163
CI Unit tests #163
Conversation
Use 'python -m unittest' from the project root to run
- pyopenssl==24.2.1 - youtube-dlp==2024.09.27 - numpy==2.1.3 Fixes building/local installs. Also fixes #155
(time is offset from the hour to alleviate high load on Github
b1463a8
to
398e8a4
Compare
An issue with oscrypto means it currently does not work on 24.04. Ref: wbond/oscrypto#78 (comment)
398e8a4
to
8f17a23
Compare
As per discussion at: #165 (comment)
This PR should be good to go. Note: ✅ Core tests (not download) are passing - they run on all compatible python versions (3.10-3.12) Notes:
|
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.
Looking good! There are a few things in the tests which could be refactored since moving to using PyTest, but we do that in a future PR and get the CI up and running first.
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.
Looks good!
|
||
archiver_class = TwitterArchiver | ||
config = {} | ||
@pytest.mark.parametrize("url, expected", [ | ||
("https://t.co/yl3oOJatFp", "https://www.bellingcat.com/category/resources/"), # t.co URL |
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.
We could even add the comments into the parameterisation for speedier debugging:
@pytest.mark.parametrize(
"input_url, expected_url, description",
[
(
"https://t.co/yl3oOJatFp",
"https://www.bellingcat.com/category/resources/",
"Should expand t.co URLs",
),
...
assert archiver.sanitize_url(input_url) == expected_url, description
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.
You're right. Nice one. Missed this before I merged, I'll save it for later!
self.assertValidResponseMetadata( | ||
post, | ||
"This month's Bellingchat Premium is with @KolinaKoltai. She reveals how she investigated a platform allowing users to create AI-generated child sexual abuse material and explains why it's crucial to investigate the people behind these services https://t.co/SfBUq0hSD0 https://t.co/rIHx0WlKp8", | ||
datetime.datetime(2024, 12, 24, 13, 44, 46, tzinfo=datetime.timezone.utc) | ||
) | ||
|
||
@pytest.mark.xfail(reason="Currently failing, sensitive content requires logged in users/cookies - not yet implemented") |
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.
Nice!
This is a WIP branch, pushing so I can test whether the workflows run successfully or not.
Also includes the following: