import os

from nose.tools import eq_

from moban.plugins import BaseEngine
from moban.jinja2.engine import Engine
from moban.jinja2.extensions import jinja_global


def test_globals():
    output = "globals.txt"
    test_dict = dict(hello="world")
    jinja_global("test", test_dict)
    path = os.path.join("tests", "fixtures", "globals")
    engine = BaseEngine([path], path, Engine)
    engine.render_to_file("basic.template", "basic.yml", output)
    with open(output, "r") as output_file:
        content = output_file.read()
        eq_(content, "world\n\ntest")
    os.unlink(output)

81caf113515dbe621cffe174b55f79365383cb31
<mask token>

<mask token>


def test_globals():
    output = 'globals.txt'
    test_dict = dict(hello='world')
    jinja_global('test', test_dict)
    path = os.path.join('tests', 'fixtures', 'globals')
    engine = BaseEngine([path], path, Engine)
    engine.render_to_file('basic.template', 'basic.yml', output)
    with open(output, 'r') as output_file:
        content = output_file.read()
        eq_(content, 'world\n\ntest')
    os.unlink(output)

import os
from nose.tools import eq_
from moban.plugins import BaseEngine
from moban.jinja2.engine import Engine
from moban.jinja2.extensions import jinja_global


def test_globals():
    output = 'globals.txt'
    test_dict = dict(hello='world')
    jinja_global('test', test_dict)
    path = os.path.join('tests', 'fixtures', 'globals')
    engine = BaseEngine([path], path, Engine)
    engine.render_to_file('basic.template', 'basic.yml', output)
    with open(output, 'r') as output_file:
        content = output_file.read()
        eq_(content, 'world\n\ntest')
    os.unlink(output)

import os

from nose.tools import eq_

from moban.plugins import BaseEngine
from moban.jinja2.engine import Engine
from moban.jinja2.extensions import jinja_global


def test_globals():
    output = "globals.txt"
    test_dict = dict(hello="world")
    jinja_global("test", test_dict)
    path = os.path.join("tests", "fixtures", "globals")
    engine = BaseEngine([path], path, Engine)
    engine.render_to_file("basic.template", "basic.yml", output)
    with open(output, "r") as output_file:
        content = output_file.read()
        eq_(content, "world\n\ntest")
    os.unlink(output)
