Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
odoo-somconnexio-python-client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Som Connexió
Odoo
odoo-somconnexio-python-client
Commits
7d2efa5a
Commit
7d2efa5a
authored
2 years ago
by
Borja Gimeno
Browse files
Options
Downloads
Patches
Plain Diff
fixing pipeline expected 2 blank lines and breaking with test
parent
22f9b94b
No related branches found
No related tags found
1 merge request
!35
New resource sponsees with test
Pipeline
#4862
failed
2 years ago
Stage: style
Stage: test
Stage: package
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
odoo_somconnexio_python_client/resources/sponsees.py
+3
-5
3 additions, 5 deletions
odoo_somconnexio_python_client/resources/sponsees.py
tests/resources/test_sponsees.py
+3
-3
3 additions, 3 deletions
tests/resources/test_sponsees.py
with
6 additions
and
8 deletions
odoo_somconnexio_python_client/resources/sponsees.py
+
3
−
5
View file @
7d2efa5a
...
...
@@ -2,6 +2,7 @@ from odoo_somconnexio_python_client.client import Client
from
..exceptions
import
ResourceNotFound
class
Sponsees
:
_url_path
=
"
partner/sponsees
"
...
...
@@ -25,14 +26,11 @@ class Sponsees:
:return: sponsees object if exists
"""
return
cls
.
_get
(
id
=
int
(
ref
))
@classmethod
def
_get
(
cls
,
id
=
None
):
response_data
=
Client
().
get
(
"
{}/{}
"
.
format
(
cls
.
_url_path
,
id
)
"
{}/{}
"
.
format
(
cls
.
_url_path
,
ref
)
)
if
not
response_data
:
raise
ResourceNotFound
(
resource
=
cls
.
__name__
,
filter
=
{})
return
cls
(
**
response_data
)
This diff is collapsed.
Click to expand it.
tests/resources/test_sponsees.py
+
3
−
3
View file @
7d2efa5a
import
unittest
import
pytest
import
unittest2
as
unittest
from
odoo_somconnexio_python_client.resources.sponsees
import
Sponsees
from
odoo_somconnexio_python_client.exceptions
import
ResourceNotFound
class
SponseesTest
(
unittest
.
TestCase
):
@pytest.mark.vcr
()
def
test_search_resource_not_found
(
self
):
assert
Tru
e
assert
Fals
e
# TODO self.assertRaises(ResourceNotFound, Sponsees.get, ref="")
@pytest.mark.vcr
()
def
test_get_with_ref
(
self
):
ref
=
"
1234
"
# TODO uncomment: sponsees = Sponsees.get(ref)
assert
Tru
e
assert
Fals
e
# TODO assert sponsees.sponsorship_code == "XXXX"
# TODO assert sponsees.sponsees_max == "X"
# TODO assert sponsees.sponsees_number == "X"
...
...
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