summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Schwager <matts@duo.com>2017-08-17 12:53:35 -0400
committerMatt Schwager <matts@duo.com>2017-08-17 14:42:31 -0400
commit57948fb06ae7bac172e9e8a87a877883c0136f0a (patch)
treed4ecf3920a21fd65fe9f671b0427708fabe9a30e
parent1fbe960350aa05cbbe88580c79b18f6a19a5f87b (diff)
downloadopenvpn-duo-plugin-57948fb06ae7bac172e9e8a87a877883c0136f0a.tar.gz
openvpn-duo-plugin-57948fb06ae7bac172e9e8a87a877883c0136f0a.zip
Fix duo_openvpn tests
``` $ python test_duo_openvpn.py ....................... ---------------------------------------------------------------------- Ran 23 tests in 0.018s OK ```
-rw-r--r--test_duo_openvpn.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/test_duo_openvpn.py b/test_duo_openvpn.py
index 87d20d1..86420d5 100644
--- a/test_duo_openvpn.py
+++ b/test_duo_openvpn.py
@@ -120,7 +120,7 @@ class TestIntegration(unittest.TestCase):
meth.AndReturn(response)
self.expected_calls.close()
- def expect_preauth(self, result, path=EXPECTED_PREAUTH_PATH):
+ def expect_preauth(self, result, path=EXPECTED_PREAUTH_PATH, factor='push1'):
self.expect_request(
method='POST',
path=path,
@@ -132,6 +132,7 @@ class TestIntegration(unittest.TestCase):
'response': {
'result': result,
'status': 'expected status',
+ 'factors': {'default': factor},
},
}),
),
@@ -384,16 +385,12 @@ class TestIntegration(unittest.TestCase):
)
def test_missing_password(self):
- environ = {
- 'ikey': self.IKEY,
- 'skey': self.SKEY,
- 'host': self.HOST,
- 'username': self.USERNAME,
- 'ipaddr': self.IPADDR,
- }
+ environ = self.normal_environ()
+ del environ['password']
+ self.expect_preauth('auth', factor=None)
self.assert_auth(
environ=environ,
- expected_control='',
+ expected_control='0',
)
def test_missing_ikey(self):