Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions testing/scrapper_test.py

This file was deleted.

29 changes: 29 additions & 0 deletions testing/testing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import unittest
import os
import function.Scrapper as scrap
#import urllib.parse, os
#import cloudscraper,re,base64,requests,random
#from bs4 import BeautifulSoup


class TestStringMethods(unittest.TestCase):
#Testing untuk api_get
'''def test_api(self)->requests.Response:
page = scrap.api_get()'''

def Test_downloadFile(self):
dl = scrap.downloadFile('https://image.tmdb.org/t/p/original/jjS7HGtulytWf4JQD5H53ou3RcM.jpg',"./tmp/")
self.assertEqual(dl, "jjS7HGtulytWf4JQD5H53ou3RcM.jpg")






def testing_urlEncode(self)-> str:
self.assertEqual(scrap.urlEncode('https://anoboy.online/series/healer-girl'))


#Testing

# Testing untuk apa
25 changes: 14 additions & 11 deletions testing/web_scrapper_test.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import unittest
import function.Scrapper as scrap

class TestStringMethods(unittest.TestCase):

pass
# def test_isupper(self):
# self.assertTrue('FOO'.isupper())
# self.assertFalse('Foo'.isupper())
class TestStringMethods(unittest.TestCase):

# def test_split(self):
# s = 'hello world'
# self.assertEqual(s.split(), ['hello', 'world'])
# # check that s.split fails when the separator is not a string
# with self.assertRaises(TypeError):
# s.split(2)
#Berfungsi untuk mengetes fungsi selectEpisode
def test_selectEpisode(self):
self.assertEqual(scrap.selectEpisode,"https://anoboy.online/episode/yuusha-yamemasu-episode-001")

#Berfungsi untuk mengetes fungsi selectMirror
def test_selectMirror(self):
self.assertEqual(scrap.selectMirror,"https://core.arc.io/broker.html?94c5673")







if __name__ == '__main__':
unittest.main()