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_has_no_processes_after_init(self):
p = environ.Procfile()
assert len(p.processes) == 0
def test_add_process(self):
p = environ.Procfile()
p.add_process('foo', 'echo 123')
assert 'echo 123' == p.processes['foo']
def test_add_process_ensures_unique_name(self):
p = environ.Procfile()
p.add_process('foo', 'echo 123')
with pytest.raises(AssertionError):
p.add_process('foo', 'echo 123')
def parse_procfile(contents):
p = Procfile()
for line in contents.splitlines():
m = PROCFILE_LINE.match(line)
if m:
p.add_process(m.group(1), m.group(2))
return p