fix(types): handle when self.username is None - #201
Closed
PrinceBunBun981 wants to merge 2 commits into
Closed
Conversation
dextmorgn
approved these changes
Jul 28, 2026
Collaborator
|
Hey @PrinceBunBun981, Thanks for this patch. There is a failing test covering this case in the CI : =================================== FAILURES ===================================
________________ test_social_account_label_without_display_name ________________
def test_social_account_label_without_display_name():
username = Username(value="johndoe")
account = SocialAccount(username=username, platform="twitter")
> assert account.nodeLabel == "johndoe@twitter"
E AssertionError: assert '@johndoe' == 'johndoe@twitter'
E
E - johndoe@twitter
E + @johndoe
tests/test_labels.py:155: AssertionError
=========================== short test summary info ============================
FAILED tests/test_labels.py::test_social_account_label_without_display_name - AssertionError: assert '@johndoe' == 'johndoe@twitter'
- johndoe@twitter
+ @johndoe
========================= 1 failed, 53 passed in 0.69s =========================
make: *** [Makefile:140: test] Error 1Could you fix it as well ? Good catch anyway ! |
Author
|
Yep, my mistake; should've run the tests before submitting the PR. |
Collaborator
|
You can also feel free to update the tests to fit the new format ;) |
Author
|
True, however, since the current format has worked for IDs and |
Author
|
Superseded by #206. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes an issue where running an enricher (like Maigret) on a Username finds accounts, but
self.usernameinsocial_account.pywasNone; adds additional checks forself.usernameand a fallback forself.id.Related traceback: Hastebin