Fix parsing of Dockerfile steps in newer versions of Docker

Fixes https://coreosdev.atlassian.net/browse/QS-24
This commit is contained in:
Joseph Schorr 2017-10-05 16:47:47 -04:00
parent 3bef21253d
commit 95868c7b78
3 changed files with 33 additions and 3 deletions

View file

@ -0,0 +1,16 @@
import pytest
from buildman.component.buildparse import extract_current_step
@pytest.mark.parametrize('input,expected_step', [
("", None),
("Step a :", None),
("Step 1 :", 1),
("Step 1 : ", 1),
("Step 1/2 : ", 1),
("Step 2/17 : ", 2),
("Step 4/13 : ARG somearg=foo", 4),
])
def test_extract_current_step(input, expected_step):
assert extract_current_step(input) == expected_step