2024-04-25 03:56:22 -07:00
|
|
|
__package__ = 'archivebox.api'
|
|
|
|
|
2024-10-04 19:16:46 -07:00
|
|
|
# from django.test import TestCase
|
|
|
|
# from ninja.testing import TestClient
|
2024-04-10 01:29:24 +02:00
|
|
|
|
2024-10-04 19:16:46 -07:00
|
|
|
# from .routes_cli import router
|
2024-04-25 03:56:22 -07:00
|
|
|
|
2024-10-04 19:16:46 -07:00
|
|
|
# class ArchiveBoxCLIAPITestCase(TestCase):
|
|
|
|
# def setUp(self):
|
|
|
|
# self.client = TestClient(router)
|
2024-04-10 01:29:24 +02:00
|
|
|
|
2024-10-04 19:16:46 -07:00
|
|
|
# def test_add_endpoint(self):
|
|
|
|
# response = self.client.post("/add", json={"urls": ["http://example.com"], "tag": "testTag1,testTag2"})
|
|
|
|
# self.assertEqual(response.status_code, 200)
|
|
|
|
# self.assertTrue(response.json()["success"])
|
2024-04-10 01:29:24 +02:00
|
|
|
|
2024-10-04 19:16:46 -07:00
|
|
|
# def test_remove_endpoint(self):
|
|
|
|
# response = self.client.post("/remove", json={"filter_patterns": ["http://example.com"]})
|
|
|
|
# self.assertEqual(response.status_code, 200)
|
|
|
|
# self.assertTrue(response.json()["success"])
|
2024-04-10 01:29:24 +02:00
|
|
|
|
2024-10-04 19:16:46 -07:00
|
|
|
# def test_update_endpoint(self):
|
|
|
|
# response = self.client.post("/update", json={})
|
|
|
|
# self.assertEqual(response.status_code, 200)
|
|
|
|
# self.assertTrue(response.json()["success"])
|
2024-04-10 01:29:24 +02:00
|
|
|
|
2024-10-04 19:16:46 -07:00
|
|
|
# def test_list_all_endpoint(self):
|
|
|
|
# response = self.client.post("/list_all", json={})
|
|
|
|
# self.assertEqual(response.status_code, 200)
|
|
|
|
# self.assertTrue(response.json()["success"])
|