Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
e5cbd849
Commit
e5cbd849
authored
Apr 20, 2020
by
Guilhem Saurel
Browse files
test models.Project
parent
cf87025b
Pipeline
#9097
passed with stage
in 2 minutes and 46 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/tests.py
View file @
e5cbd849
...
@@ -2,11 +2,34 @@ import doctest
...
@@ -2,11 +2,34 @@ import doctest
from
django.test
import
TestCase
from
django.test
import
TestCase
from
.
import
utils
from
.
import
models
,
utils
class
RainboardTests
(
TestCase
):
class
RainboardTests
(
TestCase
):
def
test_
doctest
s
(
self
):
def
test_
util
s
(
self
):
failure_count
,
test_count
=
doctest
.
testmod
(
utils
)
failure_count
,
test_count
=
doctest
.
testmod
(
utils
)
self
.
assertEqual
(
failure_count
,
0
)
self
.
assertEqual
(
failure_count
,
0
)
self
.
assertEqual
(
test_count
,
5
)
self
.
assertEqual
(
test_count
,
5
)
def
test_models
(
self
):
self
.
assertEqual
(
models
.
License
.
objects
.
count
(),
0
)
self
.
assertEqual
(
models
.
Project
.
objects
.
count
(),
0
)
models
.
License
.
objects
.
create
(
name
=
'BSD 2-Clause "Simplified" License'
,
spdx_id
=
'BSD-2-Clause'
,
url
=
'http://spdx.org/licenses/BSD-2-Clause.json'
)
models
.
Project
.
objects
.
create
(
name
=
'Rainboard Tests'
,
main_namespace
=
models
.
Namespace
.
objects
.
get
(
slug
=
'gepetto'
),
main_forge
=
models
.
Forge
.
objects
.
get
(
source
=
utils
.
SOURCES
.
github
),
license
=
models
.
License
.
objects
.
first
())
self
.
assertEqual
(
models
.
License
.
objects
.
count
(),
1
)
self
.
assertEqual
(
models
.
Project
.
objects
.
count
(),
1
)
project
=
models
.
Project
.
objects
.
first
()
self
.
assertEqual
(
project
.
slug
,
'rainboard-tests'
)
self
.
assertEqual
(
project
.
registry
(),
'memmos.laas.fr:5000'
)
self
.
assertEqual
(
project
.
url_travis
(),
'https://travis-ci.org/gepetto/rainboard-tests'
)
self
.
assertEqual
(
project
.
url_gitlab
(),
'https://gitlab.laas.fr/gepetto/rainboard-tests'
)
badges
=
project
.
badges
()
for
chunk
in
[
'<img src="https://gitlab.laas'
,
'travis-ci'
,
'href="https://gepettoweb.laas'
]:
self
.
assertIn
(
chunk
,
badges
)
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