-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sanitizing markdown and getting social media names (#63)
* sanitizing markdown and getting social media names Haven't gotten around to test this but I think it should work. Would solve #61 and #62 * Making flake happy * Minor optimization by adding a break * Rewrote as a single function * A (poor) attempt to make flake happy * Trying to make flake happy again also formatting * Fixed unclosed parenthesis * Properly labelling a function * Add test for formatted network provider * Update README I think with the github outage it didn't save my latest commit so adding this commit here to make sure the previous commit is added Co-authored-by: Martijn Boers <martijn@plebian.nl>
- Loading branch information
1 parent
1703981
commit a7a6e04
Showing
4 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import unittest | ||
|
||
from blottertrax.description_provider import DescriptionProvider | ||
|
||
|
||
class MyTestCase(unittest.TestCase): | ||
def test_format_network_to_friendly_name(self): | ||
networks = [ | ||
('social network', 'https://facebook.com/linkedpage', '[facebook](https://facebook.com/linkedpage)'), | ||
('social network', 'https://twitter.com/linkedpage', '[twitter](https://twitter.com/linkedpage)'), | ||
('social network', 'https://instagram.com/linkedpage', '[instagram](https://instagram.com/linkedpage)'), | ||
('discogs', 'https://discogs.com/linkedpage', '[discogs](https://discogs.com/linkedpage)'), | ||
('some other database', 'https://some-other-database.com/linkedpage', '[some other database](https://some-other-database.com/linkedpage)'), | ||
('wikipedia', 'https://en.wikipedia.org/wiki/Caravan_(band)', '[wikipedia](https://en.wikipedia.org/wiki/Caravan_\(band\))'), | ||
] | ||
for network_type, target, expected in networks: | ||
formatted = DescriptionProvider.format_network_to_friendly_name({ | ||
'target': target, | ||
'type': network_type | ||
}) | ||
|
||
self.assertEqual(expected, formatted) |