1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-21 01:59:10 +00:00
thefuck/tests/rules/test_docker_login.py
2019-03-28 15:51:10 +01:00

17 lines
643 B
Python

from thefuck.rules.docker_login import match, get_new_command
from thefuck.types import Command
def test_match():
err_response = """
Sending build context to Docker daemon 118.8kB
Step 1/6 : FROM foo/bar:nightly
pull access denied for foo/bar, repository does not exist or may require 'docker login'
"""
assert match(Command('docker build -t artifactory:9090/foo/bar:fdb7c6d .', err_response))
assert not match(Command('', ''))
def test_get_new_command():
assert get_new_command(Command('docker build -t artifactory:9090/foo/bar:fdb7c6d .', '')) == 'docker login && docker build -t artifactory:9090/foo/bar:fdb7c6d .'