Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_get_colours():
gen = colour.get_colours()
expect = ['cyan', 'yellow', 'green', 'magenta', 'red', 'blue']
expect = [getattr(colour, x) for x in expect]
actual = [next(gen) for _ in compat.xrange(6)]
assert_equal(expect, actual)
render = get_render(procfile, DEFAULT_OPTIONS, DEFAULT_ENV, {"foo": 4})
assert_equal(1, len(render))
(fname, contents), = render
parser = compat.ConfigParser()
parser.readfp(compat.StringIO(contents))
for job_index in compat.xrange(4):
section = "program:app-foo-{0}".format(job_index)
assert_true(parser.has_section(section))
assert_equal('PORT="{0}"'.format(DEFAULT_OPTIONS.port + job_index),
parser.get(section, "environment"))
assert_equal(parser.get("group:app", "programs"),
",".join("app-foo-{0}".format(i) for i in compat.xrange(4)))
def test_supervisord_concurrency():
procfile = get_procfile("Procfile.simple")
render = get_render(procfile, DEFAULT_OPTIONS, DEFAULT_ENV, {"foo": 4})
assert_equal(1, len(render))
(fname, contents), = render
parser = compat.ConfigParser()
parser.readfp(compat.StringIO(contents))
for job_index in compat.xrange(4):
section = "program:app-foo-{0}".format(job_index)
assert_true(parser.has_section(section))
assert_equal('PORT="{0}"'.format(DEFAULT_OPTIONS.port + job_index),
parser.get(section, "environment"))
assert_equal(parser.get("group:app", "programs"),
",".join("app-foo-{0}".format(i) for i in compat.xrange(4)))