Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
('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
('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
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
HostSpec('2001:4800:7819:103:be76:4eff:fe04:9229', '22',
'user', 'password')),
])
def test_parse_hostspec(hostspec, expected):
assert BaseBackend.parse_hostspec(hostspec) == expected
('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
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
('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')),
])
('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):
('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
('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