24 lines
576 B
Python
24 lines
576 B
Python
import unittest
|
|
|
|
from scripts import playbook
|
|
|
|
|
|
class TomlEdgeCaseTests(unittest.TestCase):
|
|
def test_minimal_parser_allows_dotted_section_name(self):
|
|
raw = """
|
|
[a.b]
|
|
key = 1
|
|
"""
|
|
data = playbook.loads_toml_minimal(raw)
|
|
self.assertIn("a.b", data)
|
|
self.assertEqual(data["a.b"]["key"], 1)
|
|
|
|
def test_minimal_parser_rejects_multiline_string(self):
|
|
raw = '[section]\nvalue = """line1\nline2"""\n'
|
|
with self.assertRaises(ValueError):
|
|
playbook.loads_toml_minimal(raw)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|