2022-12-24 16:34:24 +00:00
|
|
|
"""Unit tests for graph.py."""
|
2022-12-29 01:30:22 +00:00
|
|
|
from unittest.mock import patch
|
|
|
|
|
|
|
|
from oauth_dropins.webutil import util
|
|
|
|
from oauth_dropins.webutil.testutil import requests_response
|
|
|
|
import requests
|
|
|
|
|
|
|
|
from . import testutil
|
|
|
|
|
|
|
|
|
2022-12-30 18:10:49 +00:00
|
|
|
# @patch('requests.get')
|
|
|
|
# class XrpcGraphTest(testutil.TestCase):
|
|
|
|
|
|
|
|
# def test_getAuthorFeed(self, mock_get):
|
|
|
|
# mock_get.return_value = requests_response("""
|
|
|
|
# <body>
|
|
|
|
# </body>
|
|
|
|
# """, url='https://foo.com/')
|
|
|
|
|
|
|
|
# got = self.client.get('/xrpc/app.bsky.actor.getProfile',
|
|
|
|
# query_string={'actor': 'foo.com'},
|
|
|
|
# ).json
|
|
|
|
# self.assertEqual({
|
|
|
|
# }, got)
|
|
|
|
|
|
|
|
# def test_getPostThread(self, mock_get):
|
|
|
|
# mock_get.return_value = requests_response("""
|
|
|
|
# <body>
|
|
|
|
# </body>
|
|
|
|
# """, url='https://foo.com/')
|
|
|
|
|
|
|
|
# got = self.client.get('/xrpc/app.bsky.actor.getProfile',
|
|
|
|
# query_string={'actor': 'foo.com'},
|
|
|
|
# ).json
|
|
|
|
# self.assertEqual({
|
|
|
|
# }, got)
|
|
|
|
|
|
|
|
# def test_getRepostedBy(self, mock_get):
|
|
|
|
# mock_get.return_value = requests_response("""
|
|
|
|
# <body>
|
|
|
|
# </body>
|
|
|
|
# """, url='https://foo.com/')
|
|
|
|
|
|
|
|
# got = self.client.get('/xrpc/app.bsky.actor.getProfile',
|
|
|
|
# query_string={'actor': 'foo.com'},
|
|
|
|
# ).json
|
|
|
|
# self.assertEqual({
|
|
|
|
# }, got)
|
|
|
|
|
|
|
|
# def test_getTimeline(self, mock_get):
|
|
|
|
# mock_get.return_value = requests_response("""
|
|
|
|
# <body>
|
|
|
|
# </body>
|
|
|
|
# """, url='https://foo.com/')
|
|
|
|
|
|
|
|
# got = self.client.get('/xrpc/app.bsky.actor.getProfile',
|
|
|
|
# query_string={'actor': 'foo.com'},
|
|
|
|
# ).json
|
|
|
|
# self.assertEqual({
|
|
|
|
# }, got)
|