Skip to content

Commit

Permalink
Merge pull request #223 from SuffolkLITLab/actions/black
Browse files Browse the repository at this point in the history
Format Python code with psf/black push
  • Loading branch information
nonprofittechy authored Dec 8, 2023
2 parents 96895bd + c90279b commit e00e54e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docassemble/ALToolbox/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from .misc import button_array, ButtonDict
import xml.etree.ElementTree as ET

class TestButtonArray(unittest.TestCase):

class TestButtonArray(unittest.TestCase):
def normalize_whitespace(self, s):
return re.sub(r'\s+', ' ', s)
@patch('docassemble.ALToolbox.misc.user_has_privilege', return_value=False)
return re.sub(r"\s+", " ", s)

@patch("docassemble.ALToolbox.misc.user_has_privilege", return_value=False)
def test_button_array_generates_correct_html(self, mock_privilege):
buttons = [
ButtonDict(name="Button 1", image="image1", url="url1"),
Expand All @@ -27,14 +27,14 @@ def test_button_array_generates_correct_html(self, mock_privilege):
self.assertIn("Button 1", button_array_html)
self.assertIn("Button 2", button_array_html)


@patch('docassemble.ALToolbox.misc.user_has_privilege', return_value=False)
@patch("docassemble.ALToolbox.misc.user_has_privilege", return_value=False)
def test_button_array_filters_by_privilege(self, mock_privilege):
buttons = [
ButtonDict(name="Button 1", image="image1", url="url1", privilege="admin"),
ButtonDict(name="Button 2", image="image2", url="url2"),
]
self.assertNotIn("Button 1", button_array(buttons))

if __name__ == '__main__':
unittest.main()

if __name__ == "__main__":
unittest.main()

0 comments on commit e00e54e

Please sign in to comment.