diff --git a/testing/scrapper_test.py b/testing/scrapper_test.py deleted file mode 100644 index f544d8a..0000000 --- a/testing/scrapper_test.py +++ /dev/null @@ -1,24 +0,0 @@ -import unittest -import function.Scrapper as scrap - -class TestStringMethods(unittest.TestCase): - - def test_decode(self): - self.assertEqual(scrap.decode_base64("dGVzdGluZw=="), 'testing') - - def test_parse(self): - page = scrap.parse_web("https://example.com/") - self.assertEqual(page.find('h1').text, "Example Domain") - # def test_isupper(self): - # self.assertTrue('FOO'.isupper()) - # self.assertFalse('Foo'.isupper()) - - # 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) - -if __name__ == '__main__': - unittest.main() \ No newline at end of file diff --git a/testing/testing.py b/testing/testing.py new file mode 100644 index 0000000..f84d60a --- /dev/null +++ b/testing/testing.py @@ -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 \ No newline at end of file diff --git a/testing/web_scrapper_test.py b/testing/web_scrapper_test.py index ba6566c..acd20b1 100644 --- a/testing/web_scrapper_test.py +++ b/testing/web_scrapper_test.py @@ -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() \ No newline at end of file