コード例 #1
0
def test_critical(name, capsys):
    log = logger.get_logger(name)
    log.critical('foo')
    _, stderr = capsys.readouterr()

    assert 'ERROR: foo' in stderr
コード例 #2
0
def test_warn(name, capsys):
    log = logger.get_logger(name)
    log.warn('foo')
    stdout, _ = capsys.readouterr()

    assert 'foo' in stdout
コード例 #3
0
def test_error(name, capsys):
    log = logger.get_logger(name)
    log.error('foo')
    _, stderr = capsys.readouterr()

    assert 'foo' in stderr
コード例 #4
0
ファイル: create.py プロジェクト: retr0h/hyver
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

import click
import os
import sh

from hyver import config
from hyver import logger
from hyver import util

LOG = logger.get_logger(__name__)


class Create(object):
    def __init__(self, config):
        self._config = config
        self._cmd = None
        self._env = os.environ.copy()

    def bake(self):
        """
        Bake a `xyhve` command so it's ready to execute and returns
        None.

        :return: None
        """