mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
tests cleanup
This commit is contained in:
@@ -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=[]):
|
||||
|
Reference in New Issue
Block a user