mo processing test

This commit is contained in:
Piotr Dec 2025-11-02 23:50:24 +01:00
parent e14180cbe7
commit 9166790de9
Signed by: stawros
GPG key ID: 74B18A3F0F1E99C0
5 changed files with 31 additions and 3 deletions

0
tests/__init__.py Normal file
View file

View file

@ -0,0 +1,3 @@
value: ${sample.password}
nested: ${some.nested.value.password}
custom: ${custom.field}

21
tests/test_mo.py Normal file
View file

@ -0,0 +1,21 @@
import os
from pathlib import Path
from unittest import TestCase
from app.services import Passwords
from app.services.mo import Mo
class TestMo(TestCase):
def test_process(self):
mo = Mo(Passwords())
mo.process(Path('tests/files/test1/test.mo.yaml').absolute())
self.assertTrue(os.path.exists('tests/files/test1/test.mo'))
with open('tests/files/test1/test.mo', 'r') as f:
content = f.read()
self.assertFalse(content.__contains__('${'))
"""
value: some_oass
nested: nested_pass
custom: custom_content
"""