How to use the testinfra.backend.base.HostSpec function in testinfra

To help you get started, we’ve selected a few testinfra examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github philpep / testinfra / test / test_backends.py View on Github external
    ('pr%C3%A9nom@h', HostSpec('h', None, 'prénom', None)),
    ('pr%C3%A9nom:p%40ss%3Aw0rd@h', HostSpec('h', None, 'prénom',
                                             'p@ss:w0rd')),
    # ipv6 matching
    ('[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, None, None)),
    ('user:password@[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, 'user', 'password')),
    ('user:password@[2001:4800:7819:103:be76:4eff:fe04:9229]:22',
     HostSpec('2001:4800:7819:103:be76:4eff:fe04:9229', '22',
              'user', 'password')),
])
def test_parse_hostspec(hostspec, expected):
    assert BaseBackend.parse_hostspec(hostspec) == expected
github philpep / testinfra / test / test_backends.py View on Github external
    ('u:P@h', HostSpec('h', None, 'u', 'P')),
    ('u@h', HostSpec('h', None, 'u', None)),
    ('h', HostSpec('h', None, None, None)),
    ('pr%C3%A9nom@h', HostSpec('h', None, 'prénom', None)),
    ('pr%C3%A9nom:p%40ss%3Aw0rd@h', HostSpec('h', None, 'prénom',
                                             'p@ss:w0rd')),
    # ipv6 matching
    ('[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, None, None)),
    ('user:password@[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, 'user', 'password')),
    ('user:password@[2001:4800:7819:103:be76:4eff:fe04:9229]:22',
     HostSpec('2001:4800:7819:103:be76:4eff:fe04:9229', '22',
              'user', 'password')),
])
def test_parse_hostspec(hostspec, expected):
    assert BaseBackend.parse_hostspec(hostspec) == expected
github philpep / testinfra / test / test_backends.py View on Github external
     HostSpec('2001:db8:a0b:12f0::1', None, None, None)),
    ('user:password@[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, 'user', 'password')),
    ('user:password@[2001:4800:7819:103:be76:4eff:fe04:9229]:22',
     HostSpec('2001:4800:7819:103:be76:4eff:fe04:9229', '22',
              'user', 'password')),
])
def test_parse_hostspec(hostspec, expected):
    assert BaseBackend.parse_hostspec(hostspec) == expected
github philpep / testinfra / test / test_backends.py View on Github external
     HostSpec('2001:4800:7819:103:be76:4eff:fe04:9229', '22',
              'user', 'password')),
])
def test_parse_hostspec(hostspec, expected):
    assert BaseBackend.parse_hostspec(hostspec) == expected
github philpep / testinfra / test / test_backends.py View on Github external
    ('h', HostSpec('h', None, None, None)),
    ('pr%C3%A9nom@h', HostSpec('h', None, 'prénom', None)),
    ('pr%C3%A9nom:p%40ss%3Aw0rd@h', HostSpec('h', None, 'prénom',
                                             'p@ss:w0rd')),
    # ipv6 matching
    ('[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, None, None)),
    ('user:password@[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, 'user', 'password')),
    ('user:password@[2001:4800:7819:103:be76:4eff:fe04:9229]:22',
     HostSpec('2001:4800:7819:103:be76:4eff:fe04:9229', '22',
              'user', 'password')),
])
def test_parse_hostspec(hostspec, expected):
    assert BaseBackend.parse_hostspec(hostspec) == expected
github philpep / testinfra / test / test_backends.py View on Github external
     HostSpec('2001:db8:a0b:12f0::1', None, 'user', 'password')),
    ('user:password@[2001:4800:7819:103:be76:4eff:fe04:9229]:22',
     HostSpec('2001:4800:7819:103:be76:4eff:fe04:9229', '22',
              'user', 'password')),
])
def test_parse_hostspec(hostspec, expected):
    assert BaseBackend.parse_hostspec(hostspec) == expected
github philpep / testinfra / test / test_backends.py View on Github external
    ('u:P@h:p', HostSpec('h', 'p', 'u', 'P')),
    ('u@h:p', HostSpec('h', 'p', 'u', None)),
    ('u:P@h', HostSpec('h', None, 'u', 'P')),
    ('u@h', HostSpec('h', None, 'u', None)),
    ('h', HostSpec('h', None, None, None)),
    ('pr%C3%A9nom@h', HostSpec('h', None, 'prénom', None)),
    ('pr%C3%A9nom:p%40ss%3Aw0rd@h', HostSpec('h', None, 'prénom',
                                             'p@ss:w0rd')),
    # ipv6 matching
    ('[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, None, None)),
    ('user:password@[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, 'user', 'password')),
    ('user:password@[2001:4800:7819:103:be76:4eff:fe04:9229]:22',
     HostSpec('2001:4800:7819:103:be76:4eff:fe04:9229', '22',
              'user', 'password')),
])
github philpep / testinfra / test / test_backends.py View on Github external
    ('u@h:p', HostSpec('h', 'p', 'u', None)),
    ('u:P@h', HostSpec('h', None, 'u', 'P')),
    ('u@h', HostSpec('h', None, 'u', None)),
    ('h', HostSpec('h', None, None, None)),
    ('pr%C3%A9nom@h', HostSpec('h', None, 'prénom', None)),
    ('pr%C3%A9nom:p%40ss%3Aw0rd@h', HostSpec('h', None, 'prénom',
                                             'p@ss:w0rd')),
    # ipv6 matching
    ('[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, None, None)),
    ('user:password@[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, 'user', 'password')),
    ('user:password@[2001:4800:7819:103:be76:4eff:fe04:9229]:22',
     HostSpec('2001:4800:7819:103:be76:4eff:fe04:9229', '22',
              'user', 'password')),
])
def test_parse_hostspec(hostspec, expected):
github philpep / testinfra / test / test_backends.py View on Github external
    ('pr%C3%A9nom:p%40ss%3Aw0rd@h', HostSpec('h', None, 'prénom',
                                             'p@ss:w0rd')),
    # ipv6 matching
    ('[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, None, None)),
    ('user:password@[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, 'user', 'password')),
    ('user:password@[2001:4800:7819:103:be76:4eff:fe04:9229]:22',
     HostSpec('2001:4800:7819:103:be76:4eff:fe04:9229', '22',
              'user', 'password')),
])
def test_parse_hostspec(hostspec, expected):
    assert BaseBackend.parse_hostspec(hostspec) == expected
github philpep / testinfra / test / test_backends.py View on Github external
    ('u@h', HostSpec('h', None, 'u', None)),
    ('h', HostSpec('h', None, None, None)),
    ('pr%C3%A9nom@h', HostSpec('h', None, 'prénom', None)),
    ('pr%C3%A9nom:p%40ss%3Aw0rd@h', HostSpec('h', None, 'prénom',
                                             'p@ss:w0rd')),
    # ipv6 matching
    ('[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, None, None)),
    ('user:password@[2001:db8:a0b:12f0::1]',
     HostSpec('2001:db8:a0b:12f0::1', None, 'user', 'password')),
    ('user:password@[2001:4800:7819:103:be76:4eff:fe04:9229]:22',
     HostSpec('2001:4800:7819:103:be76:4eff:fe04:9229', '22',
              'user', 'password')),
])
def test_parse_hostspec(hostspec, expected):
    assert BaseBackend.parse_hostspec(hostspec) == expected