Skip to content

Commit 5d6c38e

Browse files
committed
add test
1 parent 3549729 commit 5d6c38e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/utils_/test_parse_uri.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,8 @@ def test_invalid_credentials(self):
7777
def test_no_prefix(self):
7878
with self.assertRaises(pymongo.errors.InvalidURI):
7979
parse_uri("cluster0.example.mongodb.net/myDatabase")
80+
81+
def test_hosts_without_ports(self):
82+
settings_dict = parse_uri("mongodb://host1.net,host2.net/myDatabase")
83+
self.assertEqual(settings_dict["HOST"], "host1.net:27017,host2.net:27017")
84+
self.assertEqual(settings_dict["PORT"], None)

0 commit comments

Comments
 (0)