import unittest
from unittest.mock import patch

from pyshowoff import Client


class TestClient(unittest.TestCase):
    def test_request(self):
        client = Client('hostname:616')
        with patch('requests.Session.send') as mock_send:
            client.request('get', '/api/v2/notebooks')
            req = mock_send.call_args[0][0]
            self.assertEqual(req.method, 'GET')
            self.assertEqual(req.url, 'http://hostname:616/api/v2/notebooks')

@@ -441,28 +441,571 @@
 name:616/api/v2/notebooks')%0A
+%0A    def test_new_notebook(self):%0A        client = Client('hostname:616')%0A        with patch('pyshowoff.Client.request') as mock_request:%0A            client.new_notebook('New notebook')%0A            method, path, data = mock_request.call_args%5B0%5D%0A            self.assertEqual(method, 'post')%0A            self.assertEqual(path, '/api/v2/notebooks')%0A            self.assertEqual(data, %7B%0A                'data': %7B%0A                    'type': 'notebooks',%0A                    'attributes': %7B'title': 'New notebook'%7D%0A                %7D%0A            %7D)%0A

Test new_notebook