1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +00:00

tests cleanup

This commit is contained in:
Ivan Mikushin
2015-09-09 11:33:54 +05:00
parent 69970ed8ed
commit 94c7eca88e
2 changed files with 44 additions and 13 deletions

View File

@@ -1,10 +1,36 @@
import itertools as it
import pytest
import subprocess
import time
def iter_lines(s):
return iter(s.readline, '')
return it.imap(str.rstrip, iter(s.readline, ''))
def strip_comment(prefix):
return lambda s: s.partition(prefix)[0].strip()
def non_empty(s):
return s != ''
def parse_value(var):
def get_value(s):
(k, _, v) = s.partition('=')
(k, v) = (k.strip(), v.strip())
if k == var:
return v
return ''
return get_value
def with_effect(p):
def effect(s):
p(s)
return s
return effect
def run_qemu(request, run_args=[]):