Skip to content
Snippets Groups Projects
Commit 7d2efa5a authored by Borja Gimeno's avatar Borja Gimeno
Browse files

fixing pipeline expected 2 blank lines and breaking with test

parent 22f9b94b
No related branches found
No related tags found
1 merge request!35New resource sponsees with test
Pipeline #4862 failed
......@@ -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)
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 True
assert False
# 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 True
assert False
# TODO assert sponsees.sponsorship_code == "XXXX"
# TODO assert sponsees.sponsees_max == "X"
# TODO assert sponsees.sponsees_number == "X"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment