mirror of
https://github.com/puppetlabs/infinitory.git
synced 2026-01-26 10:18:41 -05:00
Adding error page to infinitory
This commit is contained in:
parent
26acc1d4c6
commit
7e5f22eab6
11 changed files with 319 additions and 31 deletions
37
test/errors/test_errors.py
Normal file
37
test/errors/test_errors.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import unittest
|
||||
import infinitory.errors
|
||||
import sample
|
||||
|
||||
|
||||
class MyTest(unittest.TestCase):
|
||||
def test_error_message_cleaner(self):
|
||||
|
||||
errorParser = infinitory.errors.ErrorParser()
|
||||
|
||||
self.assertEqual(errorParser.clean_error_message("Hello"), "Hello")
|
||||
|
||||
self.assertEqual(
|
||||
errorParser.clean_error_message("Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Untrusted facts (left) don't match values from certname (right) owaijefoeiawjfoiewjf"),
|
||||
"Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Untrusted facts (left) don't match values from certname (right)"
|
||||
)
|
||||
|
||||
def test_other_prefixing(self):
|
||||
""" The cell formatter expects that all values have a prefix associated
|
||||
with them. This checks that the errorParser properly adds that
|
||||
prefix. """
|
||||
|
||||
errorParser = infinitory.errors.ErrorParser()
|
||||
|
||||
input = ["1", "2"]
|
||||
|
||||
errorParser.set_all_errors(input)
|
||||
errorParser.set_unique_errors(input)
|
||||
|
||||
self.assertEqual(
|
||||
[ { "other": "1" }, { "other": "2" } ],
|
||||
errorParser.all_errors()
|
||||
)
|
||||
self.assertEqual(
|
||||
[ { "other": "1" }, { "other": "2" } ],
|
||||
errorParser.unique_errors()
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue