How to use the honcho.compat.xrange function in honcho

To help you get started, we’ve selected a few honcho examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nickstenning / honcho / test / unit / test_colour.py View on Github external
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)
github nickstenning / honcho / test / unit / test_export_supervisord.py View on Github external
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)))
github nickstenning / honcho / test / unit / test_export_supervisord.py View on Github external
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)))