Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9348215
test_api_home.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
test_api_home.py
View Options
# Copyright (C) 2015 Stefano Zacchiroli <zack@upsilon.cc>,
# Antoine R. Dumont <antoine.romain.dumont@gmail.com>
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
import
unittest
from
nose.tools
import
istest
from
nose.plugins.attrib
import
attr
from
test_utils
import
app_client
@attr
(
'slow'
)
class
HomeTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
app
,
_
=
app_client
()
@istest
def
get_slash
(
self
):
# when
rv
=
self
.
app
.
get
(
'/'
)
# then
assert
rv
.
status_code
==
200
assert
rv
.
data
==
b
'Dev SWH API'
@istest
def
get_404
(
self
):
# when
rv
=
self
.
app
.
get
(
'/nowhere'
)
# then
assert
rv
.
status_code
==
404
@istest
def
get_bad_request
(
self
):
# when
rv
=
self
.
app
.
get
(
'/vcs/not-a-good-type/1'
)
# then
assert
rv
.
status_code
==
400
assert
rv
.
data
==
b
'Bad request!'
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Jul 4 2025, 6:17 PM (5 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3295180
Attached To
rDLDG Git loader
Event Timeline
Log In to Comment