Skip to content

Commit

Permalink
redef lambda function
Browse files Browse the repository at this point in the history
  • Loading branch information
cadenmyers13 committed Jul 26, 2024
1 parent 167c9a2 commit d97739f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/diffpy/pdfgui/tests/testaboutdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ def _clickbutton(self, button):
self.dialog.ProcessEvent(e)
return

def set_url(self, u):
setattr(self, "url", u)

def test_LogoClicks(self):
"Check handling of clicks on various logos"
d = self.dialog
stealurl = lambda u: setattr(self, "url", u)
with overridewebbrowser(stealurl):
with overridewebbrowser(self.set_url):
self._clickbutton(d.bitmap_button_nsf)
self.assertTrue(self.url.endswith("www.nsf.gov"))
self._clickbutton(d.bitmap_button_danse)
Expand Down

0 comments on commit d97739f

Please sign in to comment.