Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: rename all print/print_* methods to render/render_* to be more compatible with Python 3
- Loading branch information
Showing
4 changed files
with
47 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*.swp | ||
*.pyc | ||
**/__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import prometheus_express.metric as pm | ||
import unittest | ||
|
||
class RenderHelpTest(unittest.TestCase): | ||
def test(self): | ||
self.assertEqual([ | ||
'# HELP foo bar', | ||
'# TYPE foo bin', | ||
], pm.render_help('foo', 'bar', 'bin')) | ||
|
||
class RenderLabelsTest(unittest.TestCase): | ||
def test(self): | ||
self.assertEqual( | ||
'{foo="bar",bin="baz"}', | ||
pm.render_labels([ | ||
'foo', 'bin', | ||
], [ | ||
'bar', 'baz', | ||
]) | ||
) | ||
|
||
class RenderNameTest(unittest.TestCase): | ||
def test(self): | ||
self.assertEqual( | ||
'foo_bar', | ||
pm.render_name('foo', 'bar') | ||
) |