| Total Complexity | 2 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from unittest import TestCase |
||
| 2 | |||
| 3 | from nextcloud.requester import Requester, NextCloudConnectionError |
||
| 4 | |||
| 5 | |||
| 6 | class TestRequester(TestCase): |
||
| 7 | |||
| 8 | def test_wrong_url(self): |
||
| 9 | req = Requester('http://wrong-url.wrong', 'user', 'password', json_output=True) |
||
| 10 | exception_raised = False |
||
| 11 | try: |
||
| 12 | req.get('') |
||
| 13 | except NextCloudConnectionError as e: |
||
| 14 | exception_raised = True |
||
| 15 | assert exception_raised |
||
| 16 | |||
| 17 |