def test_lettercase(self): input = Mock(group=self.makegroup('1', 'btc', 'EuR')) bitcoin(self.phenny, input) out = self.phenny.say.call_args[0][0] self.assertRegex(out, r'\d+\.\d{2} EUR')
def test_xzzbtc(self): input = Mock(group=self.makegroup('1', 'BTC', 'XZZ')) bitcoin(self.phenny, input) out = self.phenny.say.call_args[0][0] self.assertNotRegex(out, r'[\d\.]+ BTC')
def test_invalid(self): input = Mock(group=self.makegroup('.-1', 'USD')) bitcoin(self.phenny, input) out = self.phenny.say.call_args[0][0] self.assertNotRegex(out, r'[\d\.]+ BTC')
def test_eur(self): input = Mock(group=self.makegroup('1', 'EUR')) bitcoin(self.phenny, input) out = self.phenny.say.call_args[0][0] self.assertRegex(out, r'[\d\.]+ BTC')
def test_eurbtc(self): input = Mock(group=self.makegroup('1', 'BTC', 'EUR')) bitcoin(self.phenny, input) out = self.phenny.say.call_args[0][0] self.assertRegex(out, r'\d+\.\d{2} EUR')
def test_usd_decimal(self): input = Mock(group=self.makegroup('1.25', 'USD')) bitcoin(self.phenny, input) out = self.phenny.say.call_args[0][0] self.assertRegex(out, r'[\d\.]+ BTC')