def test_from_string(self): """Check with a full string""" res = string_to_remote('name=login:[email protected]') self.assertEqual(res, ('name', {'host': '127.0.0.1', 'username': '******', 'password': '******'}), 'The function returned: %s' % str(res))
def test_from_string_no_pass(self): """Check without the optional password""" res = string_to_remote("[email protected]") self.assertEqual( res, ("name", { "host": "127.0.0.1", "username": "******" }), "The function returned: %s" % str(res), )
def test_from_string(self): """Check with a full string""" res = string_to_remote("name=login:[email protected]") self.assertEqual( res, ("name", { "host": "127.0.0.1", "username": "******", "password": "******" }), "The function returned: %s" % str(res), )
def test_from_bad_string(self): """Check that the function returns None with a non-compliant string""" res = string_to_remote("=foobar@") self.assertEqual(res, None, "The function returned: %s" % str(res))
def test_from_bad_string(self): """Check that the function returns None with a non-compliant string""" res = string_to_remote('=foobar@') self.assertEqual(res, None, 'The function returned: %s' % str(res))
def test_from_string_no_pass(self): """Check without the optional password""" res = string_to_remote('[email protected]') self.assertEqual(res, ('name', {'host': '127.0.0.1', 'username': '******'}), 'The function returned: %s' % str(res))