diff --git a/tests/utils_/test_parse_uri.py b/tests/utils_/test_parse_uri.py index a07a8e01..4e977883 100644 --- a/tests/utils_/test_parse_uri.py +++ b/tests/utils_/test_parse_uri.py @@ -77,3 +77,8 @@ def test_invalid_credentials(self): def test_no_prefix(self): with self.assertRaises(pymongo.errors.InvalidURI): parse_uri("cluster0.example.mongodb.net/myDatabase") + + def test_hosts_without_ports(self): + settings_dict = parse_uri("mongodb://host1.net,host2.net/myDatabase") + self.assertEqual(settings_dict["HOST"], "host1.net:27017,host2.net:27017") + self.assertEqual(settings_dict["PORT"], None)