Skip to content

Commit

Permalink
add bad login catcher
Browse files Browse the repository at this point in the history
  • Loading branch information
cpaillet committed Apr 20, 2016
1 parent ec5c825 commit 1f574ba
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/test_pycarwings2.py
@@ -1,7 +1,16 @@
#!/usr/bin/env python

import pycarwings2
import time
import logging
import sys
import pycarwings2
import pytest

logging.basicConfig(stream=sys.stdout, level=logging.ERROR)

def test_bad_password():
with pytest.raises(pycarwings2.CarwingsError) as excinfo:
s = pycarwings2.Session("user@domain.com", "password", "NE")
l = s.get_leaf()
assert 'INVALID' in str(excinfo.value)

s = pycarwings2.Session("user@domain.com", "password")
l = s.get_leaf()

0 comments on commit 1f574ba

Please sign in to comment.