Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kedifa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurel
kedifa
Commits
7ccb530a
Commit
7ccb530a
authored
Nov 04, 2020
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use better lib for http code
parent
56a8b248
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
42 deletions
+42
-42
kedifa/test.py
kedifa/test.py
+42
-42
No files found.
kedifa/test.py
View file @
7ccb530a
...
@@ -23,7 +23,7 @@ from builtins import object
...
@@ -23,7 +23,7 @@ from builtins import object
from
io
import
BytesIO
as
StringIO
from
io
import
BytesIO
as
StringIO
import
contextlib
import
contextlib
import
datetime
import
datetime
from
six.moves
import
http_client
as
httplib
import
http.client
import
ipaddress
import
ipaddress
import
json
import
json
import
mock
import
mock
...
@@ -271,7 +271,7 @@ class KedifaMixinCaucase(KedifaMixin):
...
@@ -271,7 +271,7 @@ class KedifaMixinCaucase(KedifaMixin):
verify
=
self
.
ca_crt_pem
,
cert
=
self
.
client_key_pem
)
verify
=
self
.
ca_crt_pem
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
result
.
status_code
,
result
.
status_code
,
six
.
moves
.
http_
client
.
CREATED
http
.
client
.
CREATED
)
)
location
=
result
.
headers
.
get
(
'Location'
,
''
)
location
=
result
.
headers
.
get
(
'Location'
,
''
)
self
.
assertRegexpMatches
(
self
.
assertRegexpMatches
(
...
@@ -403,7 +403,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -403,7 +403,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
# KeDiFa does not support nothing on / so for now it just raises
# KeDiFa does not support nothing on / so for now it just raises
# possibly in the future it will become self-describing interface
# possibly in the future it will become self-describing interface
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
BAD_REQUEST
,
http
.
client
.
BAD_REQUEST
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -415,7 +415,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -415,7 +415,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
os
.
rename
(
self
.
logfile
,
self
.
logfile
+
'.rotated'
)
os
.
rename
(
self
.
logfile
,
self
.
logfile
+
'.rotated'
)
result
=
self
.
requests_get
(
self
.
kedifa_url
)
result
=
self
.
requests_get
(
self
.
kedifa_url
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
BAD_REQUEST
,
http
.
client
.
BAD_REQUEST
,
result
.
status_code
result
.
status_code
)
)
self
.
assertLastLogEntry
(
'"GET / HTTP/1.1" 400'
)
self
.
assertLastLogEntry
(
'"GET / HTTP/1.1" 400'
)
...
@@ -424,7 +424,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -424,7 +424,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
NOT_FOUND
,
http
.
client
.
NOT_FOUND
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -438,7 +438,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -438,7 +438,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -494,7 +494,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -494,7 +494,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
six
.
moves
.
http_
client
.
UNAUTHORIZED
,
result
.
status_code
)
self
.
assertEqual
(
http
.
client
.
UNAUTHORIZED
,
result
.
status_code
)
self
.
assertEqual
(
'transport'
,
result
.
headers
.
get
(
'WWW-Authenticate'
))
self
.
assertEqual
(
'transport'
,
result
.
headers
.
get
(
'WWW-Authenticate'
))
self
.
assertEqual
(
''
,
result
.
text
)
self
.
assertEqual
(
''
,
result
.
text
)
...
@@ -509,7 +509,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -509,7 +509,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -534,7 +534,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -534,7 +534,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -546,7 +546,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -546,7 +546,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
self
.
put
()
self
.
put
()
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
)
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
UNAUTHORIZED
,
http
.
client
.
UNAUTHORIZED
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -627,7 +627,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -627,7 +627,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/1'
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
+
'/1'
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -639,7 +639,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -639,7 +639,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/list'
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
+
'/list'
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -652,7 +652,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -652,7 +652,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/list'
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
+
'/list'
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -665,7 +665,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -665,7 +665,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/list'
)
self
.
kedifa_url
+
self
.
reference
+
'/list'
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
UNAUTHORIZED
,
http
.
client
.
UNAUTHORIZED
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -695,7 +695,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -695,7 +695,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/list'
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
+
'/list'
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -706,7 +706,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -706,7 +706,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -717,7 +717,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -717,7 +717,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/2'
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
+
'/2'
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -728,7 +728,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -728,7 +728,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/1'
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
+
'/1'
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -763,7 +763,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -763,7 +763,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/list'
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
+
'/list'
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -774,7 +774,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -774,7 +774,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -785,7 +785,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -785,7 +785,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/2'
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
+
'/2'
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -796,7 +796,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -796,7 +796,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/1'
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
+
'/1'
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
NOT_FOUND
,
http
.
client
.
NOT_FOUND
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -831,7 +831,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -831,7 +831,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/list'
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
+
'/list'
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -842,7 +842,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -842,7 +842,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -853,7 +853,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -853,7 +853,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/2'
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
+
'/2'
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
OK
,
http
.
client
.
OK
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -864,7 +864,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -864,7 +864,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/1'
,
cert
=
self
.
client_key_pem
)
self
.
kedifa_url
+
self
.
reference
+
'/1'
,
cert
=
self
.
client_key_pem
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
NOT_FOUND
,
http
.
client
.
NOT_FOUND
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -878,7 +878,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -878,7 +878,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
reference
+
'/generateauth'
)
self
.
kedifa_url
+
reference
+
'/generateauth'
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
CREATED
,
http
.
client
.
CREATED
,
result
.
status_code
result
.
status_code
)
)
return
result
.
text
return
result
.
text
...
@@ -894,7 +894,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -894,7 +894,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
self
.
reference
+
'/generateauth'
)
self
.
kedifa_url
+
self
.
reference
+
'/generateauth'
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
FORBIDDEN
,
http
.
client
.
FORBIDDEN
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
'Already exists'
,
result
.
text
)
self
.
assertEqual
(
'Already exists'
,
result
.
text
)
...
@@ -904,7 +904,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -904,7 +904,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result
=
self
.
requests_get
(
result
=
self
.
requests_get
(
self
.
kedifa_url
+
key
+
'/generateauth'
)
self
.
kedifa_url
+
key
+
'/generateauth'
)
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
NOT_FOUND
,
http
.
client
.
NOT_FOUND
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -924,7 +924,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -924,7 +924,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
'Content-Type'
:
'application/x-x509-ca-cert'
,
'Content-Type'
:
'application/x-x509-ca-cert'
,
})
})
self
.
assertEqual
(
self
.
assertEqual
(
six
.
moves
.
http_
client
.
CREATED
,
http
.
client
.
CREATED
,
result
.
status_code
result
.
status_code
)
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -971,7 +971,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -971,7 +971,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
result = self.requests_put(url, data=key_pem + certificate_pem)
result = self.requests_put(url, data=key_pem + certificate_pem)
self.assertEqual(
self.assertEqual(
six.moves.http_
client.UNPROCESSABLE_ENTITY,
http.
client.UNPROCESSABLE_ENTITY,
result.status_code
result.status_code
)
)
self.assertEqual(
self.assertEqual(
...
@@ -988,7 +988,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -988,7 +988,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
result = self.requests_put(url, data=key_pem + certificate_pem)
result = self.requests_put(url, data=key_pem + certificate_pem)
self.assertEqual(
self.assertEqual(
six.moves.http_
client.UNPROCESSABLE_ENTITY,
http.
client.UNPROCESSABLE_ENTITY,
result.status_code
result.status_code
)
)
self.assertEqual(
self.assertEqual(
...
@@ -1002,7 +1002,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -1002,7 +1002,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
result = self.requests_put(url, data=key_pem + certificate_pem)
result = self.requests_put(url, data=key_pem + certificate_pem)
self.assertEqual(
self.assertEqual(
six.moves.http_
client.CREATED,
http.
client.CREATED,
result.status_code
result.status_code
)
)
self.assertEqual(
self.assertEqual(
...
@@ -1016,7 +1016,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -1016,7 +1016,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
result = self.requests_put(url, data=key_pem)
result = self.requests_put(url, data=key_pem)
self.assertEqual(
self.assertEqual(
six.moves.http_
client.UNPROCESSABLE_ENTITY,
http.
client.UNPROCESSABLE_ENTITY,
result.status_code
result.status_code
)
)
self.assertEqual(
self.assertEqual(
...
@@ -1030,7 +1030,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -1030,7 +1030,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
result = self.requests_put(url, data=certificate_pem)
result = self.requests_put(url, data=certificate_pem)
self.assertEqual(
self.assertEqual(
six.moves.http_
client.UNPROCESSABLE_ENTITY,
http.
client.UNPROCESSABLE_ENTITY,
result.status_code
result.status_code
)
)
self.assertEqual(
self.assertEqual(
...
@@ -1045,7 +1045,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -1045,7 +1045,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
result = self.requests_put(url, data=certificate_pem + key_pem)
result = self.requests_put(url, data=certificate_pem + key_pem)
self.assertEqual(
self.assertEqual(
six.moves.http_
client.UNPROCESSABLE_ENTITY,
http.
client.UNPROCESSABLE_ENTITY,
result.status_code
result.status_code
)
)
self.assertEqual(
self.assertEqual(
...
@@ -1058,7 +1058,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -1058,7 +1058,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
url = self.kedifa_url + self.reference + '
?
auth
=%
s
' % (auth, )
result = self.requests_put(url, data='
badcert
')
result = self.requests_put(url, data='
badcert
')
self.assertEqual(
self.assertEqual(
six.moves.http_
client.UNPROCESSABLE_ENTITY,
http.
client.UNPROCESSABLE_ENTITY,
result.status_code
result.status_code
)
)
self.assertEqual(
self.assertEqual(
...
@@ -1070,7 +1070,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -1070,7 +1070,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
url = self.kedifa_url + self.reference
url = self.kedifa_url + self.reference
result = self.requests_put(url, data=self.pem)
result = self.requests_put(url, data=self.pem)
self.assertEqual(
self.assertEqual(
six.moves.http_
client.BAD_REQUEST,
http.
client.BAD_REQUEST,
result.status_code
result.status_code
)
)
self.assertEqual(
self.assertEqual(
...
@@ -1082,7 +1082,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -1082,7 +1082,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
url = self.kedifa_url + self.reference + '
?
auth
=
wrong
'
url = self.kedifa_url + self.reference + '
?
auth
=
wrong
'
result = self.requests_put(url, data=self.pem)
result = self.requests_put(url, data=self.pem)
self.assertEqual(
self.assertEqual(
six.moves.http_
client.UNAUTHORIZED,
http.
client.UNAUTHORIZED,
result.status_code
result.status_code
)
)
self.assertEqual(
self.assertEqual(
...
@@ -1146,7 +1146,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -1146,7 +1146,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
self.assertEqual(1, self._getDBCertificateCount())
self.assertEqual(1, self._getDBCertificateCount())
self.assertEqual(
self.assertEqual(
six.moves.http_
client.OK,
http.
client.OK,
result.status_code
result.status_code
)
)
self.assertEqual(
self.assertEqual(
...
@@ -1170,7 +1170,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -1170,7 +1170,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
self.assertEqual(1, self._getDBCertificateCount())
self.assertEqual(1, self._getDBCertificateCount())
self.assertEqual(
self.assertEqual(
six.moves.http_
client.OK,
http.
client.OK,
result.status_code
result.status_code
)
)
self.assertEqual(
self.assertEqual(
...
@@ -1182,7 +1182,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
...
@@ -1182,7 +1182,7 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
result = self.requests_get(self.kedifa_url + '
/
!?
&&==
')
result = self.requests_get(self.kedifa_url + '
/
!?
&&==
')
self.assertEqual(
self.assertEqual(
six.moves.http_
client.BAD_REQUEST,
http.
client.BAD_REQUEST,
result.status_code
result.status_code
)
)
self.assertEqual(
self.assertEqual(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment