Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bline
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Public
PASSOFT
bline
Commits
100ffcb2
Commit
100ffcb2
authored
4 years ago
by
Maeva Pourpoint
Browse files
Options
Downloads
Patches
Plain Diff
Add unit tests to ensure code basic functionalities
parent
795e626c
No related branches found
No related tags found
1 merge request
!11
Unit tests
Pipeline
#881
passed with stage
in 44 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+1
-0
1 addition, 0 deletions
.gitlab-ci.yml
tests/test_bline.py
+10
-11
10 additions, 11 deletions
tests/test_bline.py
tox.ini
+1
-0
1 addition, 0 deletions
tox.ini
with
12 additions
and
11 deletions
.gitlab-ci.yml
+
1
−
0
View file @
100ffcb2
...
@@ -27,6 +27,7 @@ linting:
...
@@ -27,6 +27,7 @@ linting:
stage
:
test
stage
:
test
script
:
script
:
-
flake8 --ignore=F401,F811,W504 bline
-
flake8 --ignore=F401,F811,W504 bline
-
flake8 tests
python3.6
:
python3.6
:
image
:
python:3.6
image
:
python:3.6
...
...
This diff is collapsed.
Click to expand it.
tests/test_bline.py
+
10
−
11
View file @
100ffcb2
...
@@ -6,19 +6,18 @@
...
@@ -6,19 +6,18 @@
import
unittest
import
unittest
import
sys
import
sys
try
:
from
unittest.mock
import
patch
import
bline
except
ImportError
:
pass
class
TestBline
(
unittest
.
TestCase
):
class
TestBline
(
unittest
.
TestCase
):
"""
Tests for `bline` package.
"""
"""
Tests for `bline` package.
"""
def
setUp
(
self
):
"""
Set up test fixtures, if any.
"""
def
tearDown
(
self
):
"""
Tear down test fixtures, if any.
"""
def
test_import
(
self
):
def
test_import
(
self
):
self
.
assertTrue
(
'
bline
'
in
sys
.
modules
,
"
Bline import failed!
"
)
"""
Test bline import
"""
with
patch
.
object
(
sys
,
'
argv
'
,
[
'
bline
'
]):
with
self
.
assertRaises
(
SystemExit
):
try
:
import
bline.bline
as
bp
self
.
assertTrue
(
bp
.
PROG_NAME
,
'
BLINE
'
)
except
ImportError
:
self
.
fail
(
'
Failed to import bline!
'
)
This diff is collapsed.
Click to expand it.
tox.ini
+
1
−
0
View file @
100ffcb2
...
@@ -5,6 +5,7 @@ envlist = py36, py37, py38, flake8
...
@@ -5,6 +5,7 @@ envlist = py36, py37, py38, flake8
basepython
=
python
basepython
=
python
deps
=
flake8
deps
=
flake8
commands
=
flake8 --ignore=F401,F811,W504 bline
commands
=
flake8 --ignore=F401,F811,W504 bline
flake8
tests
[testenv]
[testenv]
commands
=
python -m unittest
commands
=
python -m unittest
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment