Skip to content

Commit f1e1bb8

Browse files
Add files via upload
1 parent 5604dbf commit f1e1bb8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

unittest_niconico_search_api_template.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import unittest
22
import requests
33

4+
api = "https://api.search.nicovideo.jp/api/v2/snapshot/video/contents/search"
5+
46
class TestNicoNicoSearch(unittest.TestCase):
57
def test_niconico_search_good_request(self) -> None:
6-
response = requests.post("https://api.search.nicovideo.jp/api/v2/snapshot/video/contents/search",
8+
response = requests.post(api,
79
data={
810
"q": "初音ミク",
911
"targets": "title",
@@ -17,7 +19,7 @@ def test_niconico_search_good_request(self) -> None:
1719
self.assertEqual(response.status_code, 200)
1820

1921
def test_niconico_search_bad_request(self) -> None:
20-
response = requests.post("https://api.search.nicovideo.jp/api/v2/snapshot/video/contents/search",
22+
response = requests.post(api,
2123
data={
2224
"q": "初音ミク",
2325
"targets": "title",

0 commit comments

Comments
 (0)