mirror of
https://github.com/thewesker/Video-Archive-Discord-Bot.git
synced 2025-12-20 04:11:05 -05:00
Add validation to only download for supported domains
This commit is contained in:
17
tests.py
Normal file
17
tests.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import unittest
|
||||
from validator import extractUrl, isSupportedUrl
|
||||
|
||||
class TestUrlParser(unittest.TestCase):
|
||||
|
||||
def test_supportedUrl(self):
|
||||
url = "https://vm.tiktok.com/ZSJrgyXdt/"
|
||||
supportedResponse = isSupportedUrl(url)
|
||||
self.assertEqual(supportedResponse["supported"], 'true')
|
||||
|
||||
def test_unsupportedUrl(self):
|
||||
url = "https://www.twitch.tv/robcdee/clip/AgileLivelyCucumberPartyTime"
|
||||
supportedResponse = isSupportedUrl(url)
|
||||
self.assertEqual(supportedResponse["supported"], 'false')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user