File: test_expr.py

package info (click to toggle)
yasm 1.3.0-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,880 kB
  • sloc: asm: 74,423; ansic: 53,055; python: 9,927; sh: 5,276; xml: 1,617; makefile: 214; pascal: 95; sed: 16
file content (18 lines) | stat: -rw-r--r-- 521 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from tests import TestCase, add
from yasm import Expression
import operator

class TExpression(TestCase):
    def test_create(self):
        e1 = Expression(operator.add, 1, 2)
        e2 = Expression('+', 1, 2)
        
        self.assertEquals(e1.get_intnum(), e1.get_intnum())

    def test_extract(self):
        e1 = Expression('/', 15, 5)
        self.assertEquals(e1.get_intnum(), 3)
        self.assertRaises(ValueError, e1.extract_segoff)
        self.assertRaises(ValueError, e1.extract_wrt)

add(TExpression)