示例#1
0
 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)
示例#2
0
    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)
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
    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)
示例#6
0
 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)
示例#7
0
文件: test_tfw.py 项目: vtluug/phenny
    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."
        )
示例#8
0
    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)
示例#9
0
    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)
示例#10
0
    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)
示例#11
0
    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)
示例#12
0
    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.")
示例#13
0
    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?")
示例#14
0
 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?")
示例#15
0
    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.")
示例#16
0
    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.")
示例#17
0
 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.")