def test_meter(self): self.input.group.return_value = '24060' tfw.tfw(self.phenny, self.input) out = self.phenny.say.call_args[0][0] m = re.match('^[\-\d\.]+ Meters‽ .* \- .* \- [A-Z]{4} \d{2}:\d{2}Z$', out, flags=re.UNICODE) self.assertTrue(m)
def test_fahrenheit(self): input = Mock(group=lambda x: '24060') tfw(self.phenny, input, fahrenheit=True) out = self.phenny.say.call_args[0][0] m = re.match('^\d+°F‽ .* \- .*$', out, flags=re.UNICODE) self.assertTrue(m)
def test_mev(self): input = Mock(group=lambda x: '24060') tfw(self.phenny, input) out = self.phenny.say.call_args[0][0] m = re.match('^[\d\.]+ meV‽ .* \- .*$', out, flags=re.UNICODE) self.assertTrue(m)
def test_fahrenheit(self): self.input.group.return_value = '24060' tfw.tfw(self.phenny, self.input, fahrenheit=True) out = self.phenny.say.call_args[0][0] m = re.match('^[\-\d]+°F‽ .* \- .* \- [A-Z]{4} \d{2}:\d{2}Z$', out, flags=re.UNICODE) self.assertTrue(m)
def test_badloc(self): input = Mock(group=lambda x: 'tu3jgoajgoahghqog') tfw.tfw(self.phenny, input) self.phenny.say.assert_called_once_with( "WHERE THE F**K IS THAT? I guess you might think it's a place, but no one else does. Try again." )
def test_meter(self): input = Mock(group=lambda x: '24060') tfw.tfw(self.phenny, input) out = self.phenny.say.call_args[0][0] m = re.match('^[\-\d\.]+ Meters‽ .* \- .* \- [A-Z]{4} \d{2}:\d{2}Z$', out, flags=re.UNICODE) self.assertTrue(m)
def test_celsius(self): input = Mock(group=lambda x: '24060') tfw.tfw(self.phenny, input, celsius=True) out = self.phenny.say.call_args[0][0] m = re.match('^[\-\d]+°C‽ .* \- .* \- [A-Z]{4} \d{2}:\d{2}Z$', out, flags=re.UNICODE) self.assertTrue(m)
def test_badloc(self): input = Mock(group=lambda x: 'tu3jgoajgoahghqog') tfw.tfw(self.phenny, input) self.phenny.say.assert_called_once_with( "WHERE THE F**K IS THAT? Try another location.")
def test_badloc(self): input = Mock(group=lambda x: 'tu3jgoajgoahghqog') tfw(self.phenny, input) self.phenny.say.assert_called_once_with( "UNKNOWN F*****G LOCATION. Try another?")
def test_badloc(self): input = Mock(group=lambda x: 'tu3jgoajgoahghqog') tfw(self.phenny, input) self.phenny.say.assert_called_once_with("UNKNOWN F*****G LOCATION. Try another?")
def test_badloc(self): input = Mock(group=lambda x: 'tu3jgoajgoahghqog') tfw.tfw(self.phenny, input) self.phenny.say.assert_called_once_with( "WHERE THE F**K IS THAT? I guess you might think it's a place, but no one else does. Try again.")
def test_badloc(self): self.input.group.return_value = 'tu3jgoajgoahghqog' tfw.tfw(self.phenny, self.input) self.phenny.say.assert_called_once_with( "WHERE THE F**K IS THAT? Try another location.")