mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 15:16:41 +00:00
OpenMetrics Tests WIP
This commit is contained in:
parent
30771149fc
commit
fca1482b35
@ -1,4 +1,6 @@
|
||||
import mock
|
||||
from twisted.trial import unittest
|
||||
from allmydata.web.status import Statistics
|
||||
|
||||
class FakeStatsProvider(object):
|
||||
def get_stats(self):
|
||||
@ -6,6 +8,18 @@ class FakeStatsProvider(object):
|
||||
return stats
|
||||
|
||||
class OpenMetrics(unittest.TestCase):
|
||||
def test_spec_compliance(self):
|
||||
self.assertEqual('1', '2')
|
||||
def test_header(self):
|
||||
req = mock.Mock()
|
||||
stats = mock.Mock()
|
||||
stats._provider = FakeStatsProvider()
|
||||
metrics = Statistics.render_OPENMETRICS(stats, req)
|
||||
req.setHeader.assert_called_with("content-type", "application/openmetrics-text; version=1.0.0; charset=utf-8")
|
||||
|
||||
def test_spec_compliance(self):
|
||||
req = mock.Mock()
|
||||
stats = mock.Mock()
|
||||
stats._provider = FakeStatsProvider()
|
||||
metrics = Statistics.render_OPENMETRICS(stats, req)
|
||||
# TODO test that output adheres to spec
|
||||
# TODO add more realistic stats, incl. missing (None) values
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user