mo processing test
This commit is contained in:
parent
9166790de9
commit
e3a37419e8
1 changed files with 7 additions and 1 deletions
|
|
@ -2,6 +2,8 @@ import os
|
|||
from pathlib import Path
|
||||
from unittest import TestCase
|
||||
|
||||
import yaml
|
||||
|
||||
from app.services import Passwords
|
||||
from app.services.mo import Mo
|
||||
|
||||
|
|
@ -11,9 +13,13 @@ class TestMo(TestCase):
|
|||
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:
|
||||
with open('tests/files/test1/test.yaml', 'r') as f:
|
||||
content = f.read()
|
||||
self.assertFalse(content.__contains__('${'))
|
||||
parsed = yaml.load(content, Loader=yaml.FullLoader)
|
||||
self.assertEqual(parsed['value'], 'some_oass')
|
||||
self.assertEqual(parsed['nested'], 'nested_pass')
|
||||
self.assertEqual(parsed['custom'], 'custom_content')
|
||||
"""
|
||||
value: some_oass
|
||||
nested: nested_pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue