Skip to content

Commit

Permalink
Add test for passwordfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Oderbolz committed May 24, 2015
1 parent 9a1432e commit 8260a20
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/fixtures/passwordfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
testosm:testpass
18 changes: 18 additions & 0 deletions tests/helper_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
from . import osmapi_tests
import osmapi
import mock
import os

__location__ = os.path.realpath(
os.path.join(
os.getcwd(),
os.path.dirname(__file__)
)
)


class TestOsmApiHelper(osmapi_tests.TestOsmApi):
Expand All @@ -23,6 +31,16 @@ def setupMock(self, status=200):
self.api._username = 'testuser'
self.api._password = 'testpassword'

def test_passwordfile(self):
path = os.path.join(
__location__,
'fixtures',
'passwordfile.txt'
)
my_api = osmapi.OsmApi(passwordfile=path)
self.assertEquals('testosm', my_api._username)
self.assertEquals('testpass', my_api._password)

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

0 comments on commit 8260a20

Please sign in to comment.