Skip to content

Commit

Permalink
Test Ansible Config parsing. fixed #3
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidwhiteside committed Aug 2, 2015
1 parent 5a68ac1 commit b4b2f31
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/units/test_ansiblecfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os
import unittest
from ansibledocgen.parser.ansiblecfg import AnsibleCfg

class TestAnsibleCfg(unittest.TestCase):
def test_ansiblecfg(self):
localdir = os.path.dirname(os.path.realpath(__file__))
testfile = os.path.join(localdir, ".output/ansible.cfg")
with open(testfile, "w") as f:
f.write("\n roles_path = role1:role2\n")

ansiblecfg = AnsibleCfg(os.path.dirname(testfile))

assert( "roles_path" in ansiblecfg.settings )

assert( "role1" in ansiblecfg.settings["roles_path"] )

assert( "role2" in ansiblecfg.settings["roles_path"] )

0 comments on commit b4b2f31

Please sign in to comment.