Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
satella
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
satella
Commits
7c7407e7
Commit
7c7407e7
authored
5 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
add extra tests for exceptions
parent
7d4ec80e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
satella/exceptions.py
+3
-3
3 additions, 3 deletions
satella/exceptions.py
tests/test_exceptions.py
+14
-0
14 additions, 0 deletions
tests/test_exceptions.py
with
17 additions
and
3 deletions
satella/exceptions.py
+
3
−
3
View file @
7c7407e7
class
BaseSatellaException
(
Exception
):
def
__init__
(
self
,
msg
):
super
(
BaseSatellaException
,
self
).
__init__
(
)
def
__init__
(
self
,
msg
,
*
args
,
**
kwargs
):
super
(
).
__init__
(
*
((
msg
,
)
+
args
)
)
self
.
msg
=
msg
def
__str__
(
self
):
return
'
%s(%s)
'
%
(
self
.
__class__
.
__qualname__
,
repr
(
self
.
msg
),
)
return
'
%s(%s)
'
%
(
(
self
.
__class__
.
__qualname__
,
)
+
self
.
args
)
class
ResourceLocked
(
BaseSatellaException
):
...
...
This diff is collapsed.
Click to expand it.
tests/test_exceptions.py
0 → 100644
+
14
−
0
View file @
7c7407e7
import
unittest
import
typing
as
tp
from
satella.exceptions
import
BaseSatellaException
class
TestExceptions
(
unittest
.
TestCase
):
def
test_exception
(
self
):
try
:
raise
BaseSatellaException
(
'
message
'
,
'
arg1
'
,
'
arg2
'
)
except
BaseSatellaException
as
e
:
self
.
assertIn
(
'
arg1
'
,
str
(
e
))
self
.
assertIn
(
'
arg2
'
,
str
(
e
))
else
:
self
.
fail
()
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