예제 #1
0
    def test_playbook_treeview(self):
        ctx = ansible_run()
        treeview = jsonutils.loads(u.playbook_treeview(ctx['playbook'].id))

        # ansible_run provides two fake files:
        # /some/path/main.yml and /playbook.yml
        for f in treeview:
            if f['text'] == 'some':
                self.assertEqual(f['text'], 'some')
                child = f['nodes'][0]
                self.assertEqual(child['text'], 'path')
                child = child['nodes'][0]
                self.assertEqual(child['text'], 'main.yml')
                self.assertEqual(child['dataAttr']['load'],
                                 ctx['task_file'].id)
            else:
                self.assertEqual(f['text'], 'playbook.yml')
                self.assertEqual(f['dataAttr']['load'], ctx['pb_file'].id)
예제 #2
0
파일: test_utils.py 프로젝트: dmsimard/ara
    def test_playbook_treeview(self):
        ctx = ansible_run()
        treeview = jsonutils.loads(u.playbook_treeview(ctx['playbook'].id))

        # ansible_run provides two fake files:
        # /some/path/main.yml and /playbook.yml
        for f in treeview:
            if f['text'] == 'some':
                self.assertEqual(f['text'], 'some')
                child = f['nodes'][0]
                self.assertEqual(child['text'], 'path')
                child = child['nodes'][0]
                self.assertEqual(child['text'], 'main.yml')
                self.assertEqual(child['dataAttr']['load'],
                                 ctx['task_file'].id + '/')
            else:
                self.assertEqual(f['text'], 'playbook.yml')
                self.assertEqual(
                    f['dataAttr']['load'], ctx['pb_file'].id + '/'
                )
예제 #3
0
파일: filters.py 프로젝트: rowhit/ara-1
 def jinja_treeview(playbook):
     return playbook_treeview(playbook)
예제 #4
0
파일: webapp.py 프로젝트: dmsimard/ara
 def jinja_treeview(playbook):
     return playbook_treeview(playbook)