summaryrefslogtreecommitdiff
path: root/tests/glibext
diff options
context:
space:
mode:
Diffstat (limited to 'tests/glibext')
-rw-r--r--tests/glibext/binportion.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/glibext/binportion.py b/tests/glibext/binportion.py
index a95352e..8d5f3af 100644
--- a/tests/glibext/binportion.py
+++ b/tests/glibext/binportion.py
@@ -1,6 +1,3 @@
-#!/usr/bin/python3-dbg
-# -*- coding: utf-8 -*-
-
from chrysacase import ChrysalideTestCase
from pychrysalide.arch import vmpa
@@ -14,7 +11,7 @@ class TestPathNames(ChrysalideTestCase):
def testPortionProperties(self):
"""Validate various binary portion properties."""
- p = BinPortion(BinPortion.BPC_RAW, 0x102, 10)
+ p = BinPortion(BinPortion.BinaryPortionCode.RAW, 0x102, 10)
p.desc = 'ABC'
self.assertEqual(p.desc, 'ABC')
@@ -29,14 +26,14 @@ class TestPathNames(ChrysalideTestCase):
p.continuation = False
self.assertFalse(p.continuation)
- p.rights = BinPortion.PAC_ALL
- self.assertEqual(p.rights, BinPortion.PAC_READ | BinPortion.PAC_WRITE | BinPortion.PAC_EXEC)
+ p.rights = BinPortion.PortionAccessRights.ALL
+ self.assertEqual(p.rights, BinPortion.PortionAccessRights.READ | BinPortion.PortionAccessRights.WRITE | BinPortion.PortionAccessRights.EXEC)
def testPortionMethods(self):
"""Validate some binary portion methods."""
- p = BinPortion(BinPortion.BPC_RAW, 0x102, 10)
+ p = BinPortion(BinPortion.BinaryPortionCode.RAW, 0x102, 10)
self.assertEqual(p.range.length, 10)
@@ -52,9 +49,9 @@ class TestPathNames(ChrysalideTestCase):
def testPortionComparison(self):
"""Compare different binary portions."""
- p0 = BinPortion(BinPortion.BPC_CODE, 0x102, 10)
+ p0 = BinPortion(BinPortion.BinaryPortionCode.CODE, 0x102, 10)
- addr = vmpa(vmpa.VMPA_NO_PHYSICAL, 0x102)
- p1 = BinPortion(BinPortion.BPC_CODE, addr, 10)
+ addr = vmpa(vmpa.VmpaSpecialValue.NO_PHYSICAL, 0x102)
+ p1 = BinPortion(BinPortion.BinaryPortionCode.CODE, addr, 10)
self.assertEqual(p0, p1)