def test_none(self): callsign = 'XFOOBAR' input = Mock(group=lambda x: callsign) fcc(self.phenny, input) self.phenny.reply.assert_called_once_with('No results found for '\ '{0}'.format(callsign))
def test_result(self): callsign = 'KK4EWT' ham = 'JAMES B WILLIAMS' key = 3326562 self.input.group.return_value = callsign fcc(self.phenny, self.input) self.phenny.say.assert_called_once_with( '{0} - {1} - ' 'http://wireless2.fcc.gov/UlsApp/UlsSearch/license.jsp?licKey={2}'. format(callsign, ham, key))
def test_result(self): callsign = 'KK4EWT' ham = 'JAMES B WILLIAMS' key = 3326562 input = Mock(group=lambda x: 'KK4EWT') fcc(self.phenny, input) self.phenny.say.assert_called_once_with('{0} - {1} - '\ 'http://wireless2.fcc.gov/UlsApp/UlsSearch/license.jsp?licKey={2}' .format(callsign, ham, key))
def test_none(self): callsign = 'XFOOBAR' self.input.group.return_value = callsign fcc(self.phenny, self.input) self.phenny.reply.assert_called_once_with( 'No results found for {0}'.format(callsign))
def test_fcc_none(self): self.input.group = lambda x: [None, None, "NOTACODE"][x] fcc_module.fcc(self.phenny, self.input) out = self.phenny.reply.call_args[0][0] self.assertTrue("No results found" in out)
def test_fcc(self): self.input.group = lambda x: [None, None, "W3AJ"][x] fcc_module.fcc(self.phenny, self.input) out = self.phenny.say.call_args[0][0] self.assertTrue("SWARTHMORE" in out)
def test_fcc_help(self): self.input.group = lambda x: [None, None, None][x] fcc_module.fcc(self.phenny, self.input) out = self.phenny.say.call_args[0][0] self.assertTrue("Look up a callsign issued by the FCC" in out)