Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Raphaël Enrici
burp-ui
Commits
e7d50a0b
Commit
e7d50a0b
authored
Dec 01, 2014
by
Benjamin "Ziirish" SANS
Browse files
improve tests coverage
parent
2b601388
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test_burpui.py
View file @
e7d50a0b
...
...
@@ -56,7 +56,6 @@ class BurpuiAPITestCase(TestCase):
def
test_config_parsing
(
self
):
response
=
self
.
client
.
get
(
'/api/server-config'
)
print
response
.
json
self
.
assertEquals
(
response
.
json
,
dict
(
results
=
[],
boolean
=
bui
.
cli
.
get_parser_attr
(
'boolean'
),
server_doc
=
bui
.
cli
.
get_parser_attr
(
'server_doc'
),
...
...
@@ -86,6 +85,28 @@ class BurpuiAPITestCase(TestCase):
def
test_live
(
self
):
response
=
self
.
client
.
get
(
'/api/live.json'
)
self
.
assertEquals
(
response
.
json
,
dict
(
results
=
[]))
def
test_running
(
self
):
response
=
self
.
client
.
get
(
'/api/running.json'
)
self
.
assertEquals
(
response
.
json
,
dict
(
results
=
False
))
def
test_client_tree
(
self
):
response
=
self
.
client
.
get
(
'/api/client-tree.json/toto/1'
)
self
.
assertEquals
(
response
.
json
,
{
u
'notif'
:[[
2
,
u
'Cannot contact burp server at 127.0.0.1:9999'
]]})
def
test_clients_report_json
(
self
):
response
=
self
.
client
.
get
(
'/api/clients-report.json'
)
self
.
assertEquals
(
response
.
json
,
{
u
'notif'
:[[
2
,
u
'Cannot contact burp server at 127.0.0.1:9999'
]]})
def
test_client_stat_json
(
self
):
response
=
self
.
client
.
get
(
'/api/client-stat.json/toto'
)
self
.
assertEquals
(
response
.
json
,
{
u
'notif'
:[[
2
,
u
'Cannot contact burp server at 127.0.0.1:9999'
]]})
response
=
self
.
client
.
get
(
'/api/client-stat.json/toto/1'
)
self
.
assertEquals
(
response
.
json
,
{
u
'notif'
:[[
2
,
u
'Cannot contact burp server at 127.0.0.1:9999'
]]})
def
test_client_json
(
self
):
response
=
self
.
client
.
get
(
'/api/client.json/toto'
)
self
.
assertEquals
(
response
.
json
,
{
u
'notif'
:[[
2
,
u
'Cannot contact burp server at 127.0.0.1:9999'
]]})
class
BurpuiRoutesTestCase
(
TestCase
):
...
...
@@ -109,6 +130,10 @@ class BurpuiRoutesTestCase(TestCase):
def
test_config_render
(
self
):
response
=
self
.
client
.
get
(
'/settings'
)
assert
'Burp Configuration'
in
response
.
data
def
test_live_monitor
(
self
):
response
=
self
.
client
.
get
(
'/live-monitor'
,
follow_redirects
=
True
)
assert
'Sorry, there are no running backups'
in
response
.
data
class
BurpuiLoginTestCase
(
TestCase
):
...
...
@@ -136,7 +161,6 @@ class BurpuiLoginTestCase(TestCase):
def
test_login_ok
(
self
):
rv
=
self
.
login
(
'admin'
,
'admin'
)
print
rv
.
data
assert
'Logged in successfully'
in
rv
.
data
def
test_login_ko
(
self
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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