Add nightly realm reports and observed bot activity explanations
Core tests / core (push) Successful in 59s
Core tests / core (push) Successful in 59s
This commit is contained in:
@@ -56,6 +56,14 @@ class SpectatorTests(unittest.TestCase):
|
||||
with patch.object(m.SNAPSHOT,'get',return_value={'state':{'bots':[]}}):
|
||||
with urllib.request.urlopen(base+'/api/state') as response:
|
||||
self.assertEqual(json.load(response),{'bots':[]})
|
||||
with patch.object(m,'local_get',return_value=b'{"reports":[]}') as upstream:
|
||||
with urllib.request.urlopen(base+'/api/realm-insights') as response:
|
||||
self.assertEqual(json.load(response),{'reports':[]})
|
||||
upstream.assert_called_once_with('/api/realm-insights')
|
||||
with self.assertRaises(urllib.error.HTTPError) as error:
|
||||
urllib.request.urlopen(urllib.request.Request(base+'/api/realm-insights',method='POST',data=b'{}'))
|
||||
self.assertEqual(error.exception.code,405)
|
||||
error.exception.close()
|
||||
for method in ['POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS', 'TRACE']:
|
||||
with self.assertRaises(urllib.error.HTTPError) as error:
|
||||
urllib.request.urlopen(urllib.request.Request(base + '/api/actions', method=method, data=b'{}'))
|
||||
|
||||
Reference in New Issue
Block a user