Skip to content

Commit

Permalink
Merge pull request #108 from metaodi/test-for-passwordfile
Browse files Browse the repository at this point in the history
Add test for password with colon
  • Loading branch information
metaodi committed Oct 4, 2020
2 parents 5fe3894 + b68f5a5 commit db80a1e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@ MANIFEST
*.egg-info
.coverage
.tox
.pycache/*
2 changes: 2 additions & 0 deletions tests/fixtures/passwordfile_colon.txt
@@ -0,0 +1,2 @@
testosm:testpass
testuser:test:userpass
10 changes: 10 additions & 0 deletions tests/helper_tests.py
Expand Up @@ -46,6 +46,16 @@ def test_passwordfile_with_user(self):
self.assertEquals('testuser', my_api._username)
self.assertEquals('testuserpass', my_api._password)

def test_passwordfile_with_colon(self):
path = os.path.join(
__location__,
'fixtures',
'passwordfile_colon.txt'
)
my_api = osmapi.OsmApi(username='testuser', passwordfile=path)
self.assertEquals('testuser', my_api._username)
self.assertEquals('test:userpass', my_api._password)

def test_http_request_get(self):
response = self.api._http_request(
'GET',
Expand Down

0 comments on commit db80a1e

Please sign in to comment.