Skip to content

Commit

Permalink
Update cli test_credentials tests
Browse files Browse the repository at this point in the history
Update the tests so they pass after the issue #330 being
resolved.

Close #111
  • Loading branch information
elyezer committed Jan 15, 2018
1 parent 19a172a commit 7c5dccc
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions camayoc/tests/qcs/cli/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from pathlib import Path

import pexpect
import pytest

from camayoc import utils
from camayoc.constants import (
Expand Down Expand Up @@ -166,8 +165,6 @@ def test_add_with_username_sshkeyfile_sudo_password(
)


@pytest.mark.xfail(
reason='https://github.com/quipucords/quipucords/issues/330')
def test_edit_username(isolated_filesystem, qpc_server_config):
"""Edit an auth's username.
Expand Down Expand Up @@ -201,8 +198,8 @@ def test_edit_username(isolated_filesystem, qpc_server_config):
'qpc cred edit --name={} --username={}'.format(name, new_username)
)
qpc_cred_edit.logfile = BytesIO()
assert qpc_cred_edit.expect(pexpect.EOF) == 0
assert qpc_cred_edit.expect('Credential \'{}\' updated'.format(name)) == 0
assert qpc_cred_edit.expect(
'Credential "{}" was updated'.format(name)) == 0
assert qpc_cred_edit.expect(pexpect.EOF) == 0
qpc_cred_edit.close()
assert qpc_cred_edit.exitstatus == 0
Expand Down Expand Up @@ -248,8 +245,6 @@ def test_edit_username_negative(isolated_filesystem, qpc_server_config):
assert qpc_cred_edit.exitstatus != 0


@pytest.mark.xfail(
reason='https://github.com/quipucords/quipucords/issues/330')
def test_edit_password(isolated_filesystem, qpc_server_config):
"""Edit an auth's password.
Expand Down Expand Up @@ -287,7 +282,8 @@ def test_edit_password(isolated_filesystem, qpc_server_config):
)
assert qpc_cred_edit.expect(CONNECTION_PASSWORD_INPUT) == 0
qpc_cred_edit.sendline(new_password)
assert qpc_cred_edit.expect('Credential \'{}\' updated'.format(name)) == 0
assert qpc_cred_edit.expect(
'Credential "{}" was updated'.format(name)) == 0
assert qpc_cred_edit.expect(pexpect.EOF) == 0
qpc_cred_edit.close()
assert qpc_cred_edit.exitstatus == 0
Expand Down Expand Up @@ -332,8 +328,6 @@ def test_edit_password_negative(isolated_filesystem, qpc_server_config):
assert qpc_cred_edit.exitstatus != 0


@pytest.mark.xfail(
reason='https://github.com/quipucords/quipucords/issues/330')
def test_edit_sshkeyfile(isolated_filesystem, qpc_server_config):
"""Edit an auth's sshkeyfile.
Expand Down Expand Up @@ -368,7 +362,8 @@ def test_edit_sshkeyfile(isolated_filesystem, qpc_server_config):
.format(name, new_sshkeyfile.name)
)
qpc_cred_edit.logfile = BytesIO()
assert qpc_cred_edit.expect('Credential \'{}\' updated'.format(name)) == 0
assert qpc_cred_edit.expect(
'Credential "{}" was updated'.format(name)) == 0
assert qpc_cred_edit.expect(pexpect.EOF) == 0
qpc_cred_edit.close()
assert qpc_cred_edit.exitstatus == 0
Expand Down Expand Up @@ -416,8 +411,6 @@ def test_edit_sshkeyfile_negative(isolated_filesystem, qpc_server_config):
assert qpc_cred_edit.exitstatus != 0


@pytest.mark.xfail(
reason='https://github.com/quipucords/quipucords/issues/330')
def test_edit_sudo_password(isolated_filesystem, qpc_server_config):
"""Edit an auth's sudo password.
Expand Down Expand Up @@ -460,7 +453,8 @@ def test_edit_sudo_password(isolated_filesystem, qpc_server_config):
)
assert qpc_cred_edit.expect(SUDO_PASSWORD_INPUT) == 0
qpc_cred_edit.sendline(new_sudo_password)
assert qpc_cred_edit.expect('Credential \'{}\' updated'.format(name)) == 0
assert qpc_cred_edit.expect(
'Credential "{}" was updated'.format(name)) == 0
assert qpc_cred_edit.expect(pexpect.EOF) == 0
qpc_cred_edit.close()
assert qpc_cred_edit.exitstatus == 0
Expand Down

0 comments on commit 7c5dccc

Please sign in to comment.