Skip to content

Commit

Permalink
black + isort fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarkentin committed Dec 23, 2021
1 parent 3730e60 commit 217a80d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

import logging
import unittest
from unittest import mock
from unittest.mock import MagicMock, patch

from django.test.client import Client
from django.urls import reverse
from unittest import mock
from unittest.mock import MagicMock, patch

from watchman import settings as watchman_settings
from watchman.decorators import check

Expand All @@ -38,16 +39,15 @@ def test_200_ok_if_matching_first_token_in_list(self):
response = self.client.get(reverse("status"), data)
self.assertEqual(response.status_code, 200)

@patch('django.db.connections')
@patch("django.db.connections")
def test_cursor_is_called(self, mock_connections):
cursor_mock = MagicMock()
mock_connections['default'].cursor().__enter__.return_value = cursor_mock
mock_connections["default"].cursor().__enter__.return_value = cursor_mock
data = {
'watchman-token': 't1',
"watchman-token": "t1",
}
self.client.get(reverse('status'), data)
cursor_mock.execute.assert_called_once_with('SELECT 1')

self.client.get(reverse("status"), data)
cursor_mock.execute.assert_called_once_with("SELECT 1")

def test_200_ok_if_matching_second_token_in_list(self):
data = {
Expand Down

0 comments on commit 217a80d

Please sign in to comment.