Пример #1
0
    env = dict(filters=dict(url=url), tests=dict(above5=is_fiveOrAbove))
    result = load(yaml_text, context, jinja_env=env, patchable=False)
    result = result["yinja"]
    assert result["text"] == "project"
    assert result["text2"] == "version"
    assert result["url"] == "http://example.com/yinja/5.0.1/"

    context["version"] = "3.0.0"
    result = load(yaml_text, context, jinja_env=env, patchable=False)
    result = result["yinja"]
    assert result["text"] == "project"
    assert result["text2"] == "version"
    assert result["url"] == "http://example.com"


p0 = HERE.child_file("p0.yaml")
p1 = HERE.child_file("p1.yaml")
p2 = HERE.child_file("p2.yaml")
p0d = yaml.load(p0.read_all())
p1d = yaml.load(p1.read_all())
p2d = yaml.load(p2.read_all())


def test_load():
    assert compare(p0d, load(p0.path))


def test_patch_level1():
    p1a = load(p1.path)
    assert "patches" not in p1a
    assert_dotted_key_matches("config.env", p1d, p1a)
Пример #2
0
def test_child_file():
    p = File(__file__).parent
    f = p.child_file('data.dat')
    assert f.path == os.path.join(os.path.dirname(__file__), 'data.dat')
Пример #3
0
from boto.sqs import connect_to_region
from boto.sqs.queue import Queue
from fswrap import File
from gitbot import stack
from gitbot.lib.s3 import Bucket
import json
from time import sleep
import urllib2
import yaml


HERE = File(__file__).parent

# Create worker stack
config = yaml.load(HERE.parent.child_file('gitbot.yaml').read_all())
publish = yaml.load(HERE.child_file('test.gitbot.yaml').read_all())
config.update(publish)
try:
    stack.publish_stack(config, {}, debug=True)
except:
    pass

#
# Wait for stack to be operational

result = stack.get_outputs(config['publish']['stack_name'], wait=True)

print '\n Stack operational. Sending message.\n'

queue_url = result['QueueURL']
access_key = result['ManagerKey']