Ejemplo n.º 1
0
    def test_c_arctan(self):
        input = Mock(group=lambda x: 'arctan 1')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('1/2 pi')
Ejemplo n.º 2
0
    def test_c_sin(self):
        input = Mock(group=lambda x: 'sin 0')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('0')
Ejemplo n.º 3
0
    def test_c_arccos(self):
        input = Mock(group=lambda x: 'arccos 1')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('0')
Ejemplo n.º 4
0
    def test_c_zeroes(self):
        input = Mock(group=lambda x: 'zeroes x^2+2x')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('[-2, 0]')
Ejemplo n.º 5
0
    def test_c_area(self):
        input = Mock(group=lambda x: 'area 2:4|x^3')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('60')
Ejemplo n.º 6
0
    def test_c_simplify(self):
        input = Mock(group=lambda x: 'simplify 2^2+2(2)')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('8')
Ejemplo n.º 7
0
    def test_c_derive(self):
        input = Mock(group=lambda x: 'derive x^2+2x')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('2 x + 2')
Ejemplo n.º 8
0
 def test_c_sqrt(self):
     self.input.group.return_value = '4^(1/2)'
     calc.c(self.phenny, self.input)
     self.phenny.say.assert_called_once_with('2')
Ejemplo n.º 9
0
 def test_c_none(self):
     self.input.group.return_value = 'aif'
     calc.c(self.phenny, self.input)
     self.phenny.say.assert_called_once_with('Sorry, no result.')
Ejemplo n.º 10
0
 def test_c_none(self):
     self.input.group.return_value = 'aif'
     c(self.phenny, self.input)
     self.phenny.reply.assert_called_once_with('Sorry, no result.')
Ejemplo n.º 11
0
 def test_c(self):
     self.input.group.return_value = '5*5'
     calc.c(self.phenny, self.input)
     self.phenny.say.assert_called_once_with('25')
Ejemplo n.º 12
0
 def test_c_scientific(self):
     self.input.group.return_value = '2^64'
     c(self.phenny, self.input)
     self.phenny.say.assert_called_once_with('1.84467440737096 * 10^19')
Ejemplo n.º 13
0
 def test_c_sqrt(self):
     self.input.group.return_value = '4^(1/2)'
     c(self.phenny, self.input)
     self.phenny.say.assert_called_once_with('2')
Ejemplo n.º 14
0
 def test_c(self):
     self.input.group.return_value = '5*5'
     c(self.phenny, self.input)
     self.phenny.say.assert_called_once_with('25')
Ejemplo n.º 15
0
 def test_c_sin(self):
     self.input.group.return_value = 'log(90)'
     calc.c(self.phenny, self.input)
     self.phenny.say.assert_called_once_with('4.499809670330265')
Ejemplo n.º 16
0
 def test_c_equation(self):
     self.input.group.return_value = '4*x+4=x*5'
     calc.c(self.phenny, self.input)
     self.phenny.say.assert_called_once_with('4')
Ejemplo n.º 17
0
    def test_c(self):
        input = Mock(group=lambda x: '5*5')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('25')
Ejemplo n.º 18
0
 def test_c_sin(self):
     self.input.group.return_value = 'log(90)'
     calc.c(self.phenny, self.input)
     self.phenny.say.assert_called_once_with('4.499809670330265')
Ejemplo n.º 19
0
    def test_c_factor(self):
        input = Mock(group=lambda x: 'factor x^2 + 2x')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('x (x + 2)')
Ejemplo n.º 20
0
    def test_c_sqrt(self):
        input = Mock(group=lambda x: '4^(1/2)')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('2')
Ejemplo n.º 21
0
    def test_c_integrate(self):
        input = Mock(group=lambda x: 'integrate x^2+2x')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('1/3 x^3 + x^2')
Ejemplo n.º 22
0
    def test_c_scientific(self):
        input = Mock(group=lambda x: '2^64')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('1.84467441 * 10^(19)')
Ejemplo n.º 23
0
    def test_c_tangent(self):
        input = Mock(group=lambda x: 'tangent 2|x^3')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('12 x + -16')
Ejemplo n.º 24
0
    def test_c_none(self):
        input = Mock(group=lambda x: 'aif')
        c(self.phenny, input)

        self.phenny.reply.assert_called_once_with('Sorry, no result.')
Ejemplo n.º 25
0
    def test_c_cos(self):
        input = Mock(group=lambda x: 'cos pi')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('-1')
Ejemplo n.º 26
0
    def test_c(self):
        input = Mock(group=lambda x: '5*5')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('25')
Ejemplo n.º 27
0
    def test_c_tan(self):
        input = Mock(group=lambda x: 'tan .03')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('0.030009')
Ejemplo n.º 28
0
    def test_c_log(self):
        input = Mock(group=lambda x: 'log 2|8')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('3')
Ejemplo n.º 29
0
    def test_c_arcsin(self):
        input = Mock(group=lambda x: 'arcsin .04')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('0.0400107')
Ejemplo n.º 30
0
    def test_c_none(self):
        input = Mock(group=lambda x: 'tangent 2lx^3')
        c(self.phenny, input)

        self.phenny.reply.assert_called_once_with('Sorry, no result.')
Ejemplo n.º 31
0
    def test_c_abs(self):
        input = Mock(group=lambda x: 'abs -3')
        c(self.phenny, input)

        self.phenny.say.assert_called_once_with('3')
Ejemplo n.º 32
0
 def test_c_equation(self):
     self.input.group.return_value = '4*x+4=x*5'
     calc.c(self.phenny, self.input)
     self.phenny.say.assert_called_once_with('4')