commit
cd50d34e2e
@ -0,0 +1,25 @@
|
||||
group: travis_latest
|
||||
language: python
|
||||
cache: pip
|
||||
matrix:
|
||||
allow_failures:
|
||||
- python: nightly
|
||||
include:
|
||||
- python: 3.6
|
||||
- python: 3.7
|
||||
dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069)
|
||||
- python: nightly
|
||||
dist: xenial
|
||||
install:
|
||||
- pip install -r requirements.txt
|
||||
- pip install flake8
|
||||
before_script:
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
script:
|
||||
- python3 -m unittest tests.all --buffer --verbose
|
||||
notifications:
|
||||
on_success: change
|
||||
on_failure: change # `always` will be the setting once code changes slow down
|
@ -1,134 +1,134 @@
|
||||
## List Of Supported Sites (133 Sites In Total!)
|
||||
1. [Instagram](https://www.instagram.com/)
|
||||
2. [Twitter](https://www.twitter.com/)
|
||||
3. [Facebook](https://www.facebook.com/)
|
||||
4. [YouTube](https://www.youtube.com/)
|
||||
5. [Blogger](https://www.blogger.com/)
|
||||
6. [Google Plus](https://plus.google.com/)
|
||||
7. [Reddit](https://www.reddit.com/)
|
||||
8. [Pinterest](https://www.pinterest.com/)
|
||||
9. [GitHub](https://www.github.com/)
|
||||
10. [Steam](https://steamcommunity.com/)
|
||||
11. [Vimeo](https://vimeo.com/)
|
||||
12. [SoundCloud](https://soundcloud.com/)
|
||||
13. [Disqus](https://disqus.com/)
|
||||
14. [Medium](https://medium.com/)
|
||||
15. [DeviantART](https://deviantart.com)
|
||||
16. [VK](https://vk.com/)
|
||||
17. [About.me](https://about.me/)
|
||||
18. [Imgur](https://imgur.com/)
|
||||
19. [9GAG](https://9gag.com/)
|
||||
20. [Flipboard](https://flipboard.com/)
|
||||
21. [SlideShare](https://slideshare.net/)
|
||||
22. [Fotolog](https://fotolog.com/)
|
||||
23. [Spotify](https://open.spotify.com/)
|
||||
24. [MixCloud](https://www.mixcloud.com/)
|
||||
25. [Scribd](https://www.scribd.com/)
|
||||
26. [Patreon](https://www.patreon.com/)
|
||||
27. [BitBucket](https://bitbucket.org/)
|
||||
28. [Roblox](https://www.roblox.com/)
|
||||
29. [Gravatar](http://en.gravatar.com/)
|
||||
30. [iMGSRC.RU](https://imgsrc.ru/)
|
||||
1. [500px](https://500px.com/)
|
||||
2. [9GAG](https://9gag.com/)
|
||||
3. [About.me](https://about.me/)
|
||||
4. [Academia.edu](https://www.academia.edu/)
|
||||
5. [AngelList](https://angel.co/)
|
||||
6. [Aptoide](https://en.aptoide.com/)
|
||||
7. [AskFM](https://ask.fm/)
|
||||
8. [BLIP.fm](https://blip.fm/)
|
||||
9. [Badoo](https://badoo.com/)
|
||||
10. [Bandcamp](https://www.bandcamp.com/)
|
||||
11. [Basecamp](https://basecamp.com/)
|
||||
12. [Behance](https://www.behance.net/)
|
||||
13. [BitBucket](https://bitbucket.org/)
|
||||
14. [BlackPlanet](http://blackplanet.com/)
|
||||
15. [Blogger](https://www.blogger.com/)
|
||||
16. [BuzzFeed](https://buzzfeed.com/)
|
||||
17. [Canva](https://www.canva.com/)
|
||||
18. [Carbonmade](https://carbonmade.com/)
|
||||
19. [CashMe](https://cash.me/)
|
||||
20. [Cloob](https://www.cloob.com/)
|
||||
21. [Codecademy](https://www.codecademy.com/)
|
||||
22. [Codementor](https://www.codementor.io/)
|
||||
23. [Codepen](https://codepen.io/)
|
||||
24. [Coderwall](https://coderwall.com/)
|
||||
25. [ColourLovers](https://www.colourlovers.com/)
|
||||
26. [Contently](https://contently.com/)
|
||||
27. [Coroflot](https://coroflot.com/)
|
||||
28. [CreativeMarket](https://creativemarket.com/)
|
||||
29. [Crevado](https://crevado.com/)
|
||||
30. [Crunchyroll](https://www.crunchyroll.com/)
|
||||
31. [DailyMotion](https://www.dailymotion.com/)
|
||||
32. [Etsy](https://www.etsy.com/)
|
||||
33. [CashMe](https://cash.me/)
|
||||
34. [Behance](https://www.behance.net/)
|
||||
35. [GoodReads](https://www.goodreads.com/)
|
||||
36. [Instructables](https://www.instructables.com/)
|
||||
37. [Keybase](https://keybase.io/)
|
||||
38. [Kongregate](https://www.kongregate.com/)
|
||||
39. [LiveJournal](https://www.livejournal.com/)
|
||||
40. [VSCO](https://vsco.co/)
|
||||
41. [AngelList](https://angel.co/)
|
||||
42. [last.fm](https://last.fm/)
|
||||
43. [Dribbble](https://dribbble.com/)
|
||||
44. [Codecademy](https://www.codecademy.com/)
|
||||
45. [Pastebin](https://pastebin.com/)
|
||||
46. [Foursquare](https://foursquare.com/)
|
||||
47. [Gumroad](https://www.gumroad.com/)
|
||||
48. [Newgrounds](https://newgrounds.com)
|
||||
49. [Wattpad](https://www.wattpad.com/)
|
||||
50. [Canva](https://www.canva.com/)
|
||||
51. [Trakt](https://www.trakt.tv/)
|
||||
52. [500px](https://500px.com/)
|
||||
53. [BuzzFeed](https://buzzfeed.com/)
|
||||
54. [TripAdvisor](https://tripadvisor.com/)
|
||||
55. [Contently](https://contently.com/)
|
||||
56. [Houzz](https://houzz.com/)
|
||||
57. [BLIP.fm](https://blip.fm/)
|
||||
58. [HackerNews](https://news.ycombinator.com/)
|
||||
59. [Codementor](https://www.codementor.io/)
|
||||
60. [ReverbNation](https://www.reverbnation.com/)
|
||||
61. [Designspiration](https://www.designspiration.net/)
|
||||
62. [Bandcamp](https://www.bandcamp.com/)
|
||||
63. [ColourLovers](https://www.colourlovers.com/)
|
||||
64. [IFTTT](https://www.ifttt.com/)
|
||||
65. [Ebay](https://www.ebay.com/)
|
||||
66. [Slack](https://slack.com)
|
||||
67. [Trip](https://www.trip.skyscanner.com/)
|
||||
68. [Ello](https://ello.co/)
|
||||
69. [HackerOne](https://hackerone.com/)
|
||||
70. [Tinder](https://tinder.com/)
|
||||
71. [We Heart It](https://weheartit.com/)
|
||||
72. [Flickr](https://www.flickr.com/)
|
||||
73. [WordPress](https://wordpress.com)
|
||||
74. [Unsplash](https://unsplash.com/)
|
||||
75. [Pexels](https://www.pexels.com/)
|
||||
76. [devRant](https://devrant.com/)
|
||||
77. [MyAnimeList](https://myanimelist.net/)
|
||||
78. [ImageShack](https://imageshack.us/)
|
||||
79. [Badoo](https://badoo.com/)
|
||||
80. [MeetMe](https://www.meetme.com/)
|
||||
81. [Quora](https://www.quora.com/)
|
||||
82. [Pixabay](https://pixabay.com/)
|
||||
83. [Giphy](https://giphy.com/)
|
||||
84. [Taringa](https://taringa.net/)
|
||||
85. [SourceForge](https://sourceforge.net/)
|
||||
86. [Codepen](https://codepen.io/)
|
||||
87. [Launchpad](https://launchpad.net/)
|
||||
88. [Photobucket](https://photobucket.com/)
|
||||
89. [Wix](https://wix.com/)
|
||||
90. [Crevado](https://crevado.com/)
|
||||
91. [Carbonmade](https://carbonmade.com/)
|
||||
92. [Coroflot](https://coroflot.com/)
|
||||
93. [Jimdo](https://jimdosite.com/)
|
||||
94. [Repl.it](https://repl.it/)
|
||||
95. [Issuu](https://issuu.com/)
|
||||
96. [YouPic](https://youpic.com/)
|
||||
97. [House-Mixes.com](https://www.house-mixes.com/)
|
||||
98. [Letterboxd](https://letterboxd.com/)
|
||||
99. [Coderwall](https://coderwall.com/)
|
||||
100. [Zhihu](https://www.zhihu.com/)
|
||||
101. [Gitee](https://gitee.com/)
|
||||
102. [Academia.edu](https://www.academia.edu/)
|
||||
103. [BlackPlanet](http://blackplanet.com/)
|
||||
104. [Cloob](https://www.cloob.com/)
|
||||
105. [Crunchyroll](https://www.crunchyroll.com/)
|
||||
106. [Rajce.net](https://www.rajce.idnes.cz/)
|
||||
107. [VirusTotal](https://www.virustotal.com/)
|
||||
108. [WebNode](https://www.webnode.cz/)
|
||||
109. [Aptoide](https://en.aptoide.com/)
|
||||
110. [GitLab](https://gitlab.com/)
|
||||
111. [NameMC (Minecraft.net skins)](https://namemc.com/)
|
||||
112. [Plug.DJ](https://plug.dj/)
|
||||
113. [Wikipedia](https://www.wikipedia.org/)
|
||||
114. [Mastodon](https://mstdn.io/)
|
||||
115. [Telegram](https://t.me/)
|
||||
116. [TradingView](https://www.tradingview.com/)
|
||||
117. [Kaggle](https://www.kaggle.com/)
|
||||
118. [Itch.io](https://itch.io/)
|
||||
119. [Basecamp](https://basecamp.com/)
|
||||
120. [ProductHunt](https://www.producthunt.com/)
|
||||
121. [Younow](https://www.younow.com/)
|
||||
122. [Smashcast](https://www.smashcast.tv/)
|
||||
123. [AskFM](https://ask.fm/)
|
||||
124. [KanoWorld](https://world.kano.me/)
|
||||
125. [EyeEm](https://www.eyeem.com/)
|
||||
126. [Wikia](http://www.wikia.com/)
|
||||
127. [CreativeMarket](https://creativemarket.com/)
|
||||
128. [Venmo](https://venmo.com/)
|
||||
129. [HubPages](https://hubpages.com/)
|
||||
130. [StreamMe](https://www.stream.me/)
|
||||
131. [Kik](http://kik.me/)
|
||||
132. [Star Citizen](https://robertsspaceindustries.com/)
|
||||
133. [EVE Online](https://eveonline.com)
|
||||
32. [Designspiration](https://www.designspiration.net/)
|
||||
33. [DeviantART](https://deviantart.com)
|
||||
34. [Disqus](https://disqus.com/)
|
||||
35. [Dribbble](https://dribbble.com/)
|
||||
36. [EVE Online](https://eveonline.com)
|
||||
37. [Ebay](https://www.ebay.com/)
|
||||
38. [Ello](https://ello.co/)
|
||||
39. [Etsy](https://www.etsy.com/)
|
||||
40. [EyeEm](https://www.eyeem.com/)
|
||||
41. [Facebook](https://www.facebook.com/)
|
||||
42. [Flickr](https://www.flickr.com/)
|
||||
43. [Flipboard](https://flipboard.com/)
|
||||
44. [Fotolog](https://fotolog.com/)
|
||||
45. [Foursquare](https://foursquare.com/)
|
||||
46. [Giphy](https://giphy.com/)
|
||||
47. [GitHub](https://www.github.com/)
|
||||
48. [GitLab](https://gitlab.com/)
|
||||
49. [Gitee](https://gitee.com/)
|
||||
50. [GoodReads](https://www.goodreads.com/)
|
||||
51. [Google Plus](https://plus.google.com/)
|
||||
52. [Gravatar](http://en.gravatar.com/)
|
||||
53. [Gumroad](https://www.gumroad.com/)
|
||||
54. [HackerNews](https://news.ycombinator.com/)
|
||||
55. [HackerOne](https://hackerone.com/)
|
||||
56. [House-Mixes.com](https://www.house-mixes.com/)
|
||||
57. [Houzz](https://houzz.com/)
|
||||
58. [HubPages](https://hubpages.com/)
|
||||
59. [IFTTT](https://www.ifttt.com/)
|
||||
60. [ImageShack](https://imageshack.us/)
|
||||
61. [Imgur](https://imgur.com/)
|
||||
62. [Instagram](https://www.instagram.com/)
|
||||
63. [Instructables](https://www.instructables.com/)
|
||||
64. [Issuu](https://issuu.com/)
|
||||
65. [Itch.io](https://itch.io/)
|
||||
66. [Jimdo](https://jimdosite.com/)
|
||||
67. [Kaggle](https://www.kaggle.com/)
|
||||
68. [KanoWorld](https://world.kano.me/)
|
||||
69. [Keybase](https://keybase.io/)
|
||||
70. [Kik](http://kik.me/)
|
||||
71. [Kongregate](https://www.kongregate.com/)
|
||||
72. [Launchpad](https://launchpad.net/)
|
||||
73. [Letterboxd](https://letterboxd.com/)
|
||||
74. [LiveJournal](https://www.livejournal.com/)
|
||||
75. [Mastodon](https://mstdn.io/)
|
||||
76. [Medium](https://medium.com/)
|
||||
77. [MeetMe](https://www.meetme.com/)
|
||||
78. [MixCloud](https://www.mixcloud.com/)
|
||||
79. [MyAnimeList](https://myanimelist.net/)
|
||||
80. [NameMC (Minecraft.net skins)](https://namemc.com/)
|
||||
81. [Newgrounds](https://newgrounds.com)
|
||||
82. [Pastebin](https://pastebin.com/)
|
||||
83. [Patreon](https://www.patreon.com/)
|
||||
84. [Pexels](https://www.pexels.com/)
|
||||
85. [Photobucket](https://photobucket.com/)
|
||||
86. [Pinterest](https://www.pinterest.com/)
|
||||
87. [Pixabay](https://pixabay.com/)
|
||||
88. [Plug.DJ](https://plug.dj/)
|
||||
89. [ProductHunt](https://www.producthunt.com/)
|
||||
90. [Quora](https://www.quora.com/)
|
||||
91. [Rajce.net](https://www.rajce.idnes.cz/)
|
||||
92. [Reddit](https://www.reddit.com/)
|
||||
93. [Repl.it](https://repl.it/)
|
||||
94. [ReverbNation](https://www.reverbnation.com/)
|
||||
95. [Roblox](https://www.roblox.com/)
|
||||
96. [Scribd](https://www.scribd.com/)
|
||||
97. [Slack](https://slack.com)
|
||||
98. [SlideShare](https://slideshare.net/)
|
||||
99. [Smashcast](https://www.smashcast.tv/)
|
||||
100. [SoundCloud](https://soundcloud.com/)
|
||||
101. [SourceForge](https://sourceforge.net/)
|
||||
102. [Spotify](https://open.spotify.com/)
|
||||
103. [Star Citizen](https://robertsspaceindustries.com/)
|
||||
104. [Steam](https://steamcommunity.com/)
|
||||
105. [StreamMe](https://www.stream.me/)
|
||||
106. [Taringa](https://taringa.net/)
|
||||
107. [Telegram](https://t.me/)
|
||||
108. [Tinder](https://tinder.com/)
|
||||
109. [TradingView](https://www.tradingview.com/)
|
||||
110. [Trakt](https://www.trakt.tv/)
|
||||
111. [Trip](https://www.trip.skyscanner.com/)
|
||||
112. [TripAdvisor](https://tripadvisor.com/)
|
||||
113. [Twitter](https://www.twitter.com/)
|
||||
114. [Unsplash](https://unsplash.com/)
|
||||
115. [VK](https://vk.com/)
|
||||
116. [VSCO](https://vsco.co/)
|
||||
117. [Venmo](https://venmo.com/)
|
||||
118. [Vimeo](https://vimeo.com/)
|
||||
119. [VirusTotal](https://www.virustotal.com/)
|
||||
120. [Wattpad](https://www.wattpad.com/)
|
||||
121. [We Heart It](https://weheartit.com/)
|
||||
122. [WebNode](https://www.webnode.cz/)
|
||||
123. [Wikia](http://www.wikia.com/)
|
||||
124. [Wikipedia](https://www.wikipedia.org/)
|
||||
125. [Wix](https://wix.com/)
|
||||
126. [WordPress](https://wordpress.com)
|
||||
127. [YouPic](https://youpic.com/)
|
||||
128. [YouTube](https://www.youtube.com/)
|
||||
129. [Younow](https://www.younow.com/)
|
||||
130. [Zhihu](https://www.zhihu.com/)
|
||||
131. [devRant](https://devrant.com/)
|
||||
132. [iMGSRC.RU](https://imgsrc.ru/)
|
||||
133. [last.fm](https://last.fm/)
|
||||
|
@ -0,0 +1,4 @@
|
||||
"""Sherlock Tests
|
||||
|
||||
This package contains various submodules used to run tests.
|
||||
"""
|
@ -0,0 +1,142 @@
|
||||
"""Sherlock Tests
|
||||
|
||||
This module contains various tests.
|
||||
"""
|
||||
from tests.base import SherlockBaseTest
|
||||
import unittest
|
||||
|
||||
|
||||
class SherlockDetectTests(SherlockBaseTest):
|
||||
def test_detect_true(self):
|
||||
"""Test Username Existence Detection.
|
||||
|
||||
This test ensures that the mechanism of ensuring that a Username
|
||||
exists works properly.
|
||||
|
||||
Keyword Arguments:
|
||||
self -- This object.
|
||||
|
||||
Return Value:
|
||||
N/A.
|
||||
Will trigger an assert if Usernames which are known to exist are
|
||||
not detected.
|
||||
"""
|
||||
|
||||
self.username_check(['jack'], ['Twitter'], exist_check=True)
|
||||
self.username_check(['dfox'], ['devRant'], exist_check=True)
|
||||
self.username_check(['blue'], ['Pinterest'], exist_check=True)
|
||||
self.username_check(['kevin'], ['Instagram'], exist_check=True)
|
||||
self.username_check(['zuck'], ['Facebook'], exist_check=True)
|
||||
|
||||
return
|
||||
|
||||
def test_detect_false_via_message(self):
|
||||
"""Test Username Does Not Exist (Via Message).
|
||||
|
||||
This test ensures that the "message" detection mechanism of
|
||||
ensuring that a Username does *not* exist works properly.
|
||||
|
||||
Keyword Arguments:
|
||||
self -- This object.
|
||||
|
||||
Return Value:
|
||||
N/A.
|
||||
Will trigger an assert if detection mechanism did not work as expected.
|
||||
"""
|
||||
|
||||
self.username_check(['jackkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk'],
|
||||
['Instagram'],
|
||||
exist_check=False
|
||||
)
|
||||
|
||||
return
|
||||
|
||||
def test_detect_false_via_status_code(self):
|
||||
"""Test Username Does Not Exist (Via Status Code).
|
||||
|
||||
This test ensures that the "status code" detection mechanism of
|
||||
ensuring that a Username does *not* exist works properly.
|
||||
|
||||
Keyword Arguments:
|
||||
self -- This object.
|
||||
|
||||
Return Value:
|
||||
N/A.
|
||||
Will trigger an assert if detection mechanism did not work as expected.
|
||||
"""
|
||||
|
||||
self.username_check(['jackkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk'],
|
||||
['Facebook'],
|
||||
exist_check=False
|
||||
)
|
||||
|
||||
return
|
||||
|
||||
def test_detect_false_via_response_url(self):
|
||||
"""Test Username Does Not Exist (Via Response URL).
|
||||
|
||||
This test ensures that the "response URL" detection mechanism of
|
||||
ensuring that a Username does *not* exist works properly.
|
||||
|
||||
Keyword Arguments:
|
||||
self -- This object.
|
||||
|
||||
Return Value:
|
||||
N/A.
|
||||
Will trigger an assert if detection mechanism did not work as expected.
|
||||
"""
|
||||
|
||||
self.username_check(['jackkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk'],
|
||||
['Pinterest'],
|
||||
exist_check=False
|
||||
)
|
||||
|
||||
return
|
||||
|
||||
|
||||
class SherlockSiteCoverageTests(SherlockBaseTest):
|
||||
def test_coverage_false_via_response_url(self):
|
||||
"""Test Username Does Not Exist Site Coverage (Via Response URL).
|
||||
|
||||
This test checks all sites with the "response URL" detection mechanism
|
||||
to ensure that a Username that does not exist is reported that way.
|
||||
|
||||
Keyword Arguments:
|
||||
self -- This object.
|
||||
|
||||
Return Value:
|
||||
N/A.
|
||||
Will trigger an assert if detection mechanism did not work as expected.
|
||||
"""
|
||||
|
||||
self.username_check(['noonewouldeverusethis7'],
|
||||
["Pinterest", "iMGSRC.RU", "Pastebin",
|
||||
"WordPress", "devRant", "ImageShack", "MeetMe"
|
||||
],
|
||||
exist_check=False
|
||||
)
|
||||
|
||||
return
|
||||
|
||||
def test_coverage_true_via_response_url(self):
|
||||
"""Test Username Does Exist Site Coverage (Via Response URL).
|
||||
|
||||
This test checks all sites with the "response URL" detection mechanism
|
||||
to ensure that a Username that does exist is reported that way.
|
||||
|
||||
Keyword Arguments:
|
||||
self -- This object.
|
||||
|
||||
Return Value:
|
||||
N/A.
|
||||
Will trigger an assert if detection mechanism did not work as expected.
|
||||
"""
|
||||
|
||||
self.username_check(['blue'],
|
||||
["Pinterest", "iMGSRC.RU", "Pastebin",
|
||||
"WordPress", "devRant", "ImageShack", "MeetMe"
|
||||
],
|
||||
exist_check=True
|
||||
)
|
||||
|
||||
return
|
@ -0,0 +1,107 @@
|
||||
"""Sherlock Base Tests
|
||||
|
||||
This module contains various utilities for running tests.
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import os.path
|
||||
import unittest
|
||||
import sherlock
|
||||
import warnings
|
||||
|
||||
|
||||
class SherlockBaseTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
"""Sherlock Base Test Setup.
|
||||
|
||||
Does common setup tasks for base Sherlock tests.
|
||||
|
||||
Keyword Arguments:
|
||||
self -- This object.
|
||||
|
||||
Return Value:
|
||||
N/A.
|
||||
"""
|
||||
|
||||
#This ignores the ResourceWarning from an unclosed SSLSocket.
|
||||
#TODO: Figure out how to fix the code so this is not needed.
|
||||
warnings.simplefilter("ignore", ResourceWarning)
|
||||
|
||||
# Load the data file with all site information.
|
||||
data_file_path = os.path.join(os.path.dirname(os.path.realpath(sherlock.__file__)), "data.json")
|
||||
with open(data_file_path, "r", encoding="utf-8") as raw:
|
||||
self.site_data_all = json.load(raw)
|
||||
|
||||
self.verbose=False
|
||||
self.tor=False
|
||||
self.unique_tor=False
|
||||
|
||||
return
|
||||
|
||||
def site_data_filter(self, site_list):
|
||||
"""Filter Site Data.
|
||||
|
||||
Keyword Arguments:
|
||||
self -- This object.
|
||||
site_list -- List of strings corresponding to sites which
|
||||
should be filtered.
|
||||
|
||||
Return Value:
|
||||
Dictionary containing sub-set of site data specified by 'site_list'.
|
||||
"""
|
||||
|
||||
# Create new dictionary that has filtered site data based on input.
|
||||
# Note that any site specified which is not understood will generate
|
||||
# an error.
|
||||
site_data = {}
|
||||
for site in site_list:
|
||||
with self.subTest(f"Checking test vector Site '{site}' "
|
||||
f"exists in total site data."
|
||||
):
|
||||
site_data[site] = self.site_data_all[site]
|
||||
|
||||
return site_data
|
||||
|
||||
def username_check(self, username_list, site_list, exist_check=True):
|
||||
"""Username Exist Check.
|
||||
|
||||
Keyword Arguments:
|
||||
self -- This object.
|
||||
username_list -- List of strings corresponding to usernames
|
||||
which should exist on *all* of the sites.
|
||||
site_list -- List of strings corresponding to sites which
|
||||
should be filtered.
|
||||
exist_check -- Boolean which indicates if this should be
|
||||
a check for Username existence,
|
||||
or non-existence.
|
||||
|
||||
Return Value:
|
||||
N/A.
|
||||
Will trigger an assert if Username does not have the expected
|
||||
existence state.
|
||||
"""
|
||||
|
||||
#Filter all site data down to just what is needed for this test.
|
||||
site_data = self.site_data_filter(site_list)
|
||||
|
||||
if exist_check:
|
||||
check_type_text = "exists"
|
||||
exist_result_desired = "yes"
|
||||
else:
|
||||
check_type_text = "does not exist"
|
||||
exist_result_desired = "no"
|
||||
|
||||
for username in username_list:
|
||||
results = sherlock.sherlock(username,
|
||||
site_data,
|
||||
verbose=self.verbose,
|
||||
tor=self.tor,
|
||||
unique_tor=self.unique_tor
|
||||
)
|
||||
for site, result in results.items():
|
||||
with self.subTest(f"Checking Username '{username}' "
|
||||
f"{check_type_text} on Site '{site}'"
|
||||
):
|
||||
self.assertEqual(result['exists'], exist_result_desired)
|
||||
|
||||
return
|
Loading…
Reference in new issue