コード例 #1
0
ファイル: test_calc.py プロジェクト: vigneshv59/phenny
    def test_wa(self):
        input = Mock(group=lambda x: 'airspeed of an unladen swallow')
        wa(self.phenny, input)

        self.phenny.say.assert_called_once_with('25 mph  (miles per hour); '\
                '(asked, but not answered, about a general swallow in the '\
                '1975 film Monty Python and the Holy Grail)')
コード例 #2
0
    def test_wa(self):
        input = Mock(group=lambda x: 'airspeed of an unladen swallow')
        wa(self.phenny, input)

        self.phenny.say.assert_called_once_with('25 mph  (miles per hour)')
コード例 #3
0
ファイル: test_calc.py プロジェクト: vigneshv59/phenny
    def test_wa_none(self):
        input = Mock(group=lambda x: "jajoajaj ojewphjqo I!tj")
        wa(self.phenny, input)

        self.phenny.reply.assert_called_once_with('Sorry, no result.')
コード例 #4
0
ファイル: test_calc.py プロジェクト: vigneshv59/phenny
    def test_wa_convert_bytes(self):
        input = Mock(group=lambda x: '5 MB/s in Mbps')
        wa(self.phenny, input)

        self.phenny.say.assert_called_once_with(
            '40 Mb/s  (megabits per second)')
コード例 #5
0
ファイル: test_calc.py プロジェクト: vigneshv59/phenny
    def test_wa_convert_deg(self):
        input = Mock(group=lambda x: '30 degrees C in F')
        wa(self.phenny, input)

        self.phenny.say.assert_called_once_with('86 °F  (degrees Fahrenheit)')
コード例 #6
0
ファイル: test_calc.py プロジェクト: vigneshv59/phenny
    def test_wa_math(self):
        input = Mock(group=lambda x: '2+2')
        wa(self.phenny, input)

        self.phenny.say.assert_called_once_with('4')