Repository navigation
Expand file tree
/
Copy pathdiffing_ByteRuns_test.py
More file actions
53 lines (42 loc) · 1.56 KB
/
Copy pathdiffing_ByteRuns_test.py
File metadata and controls
53 lines (42 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# This software was developed at the National Institute of Standards
# and Technology in whole or in part by employees of the Federal
# Government in the course of their official duties. Pursuant to
# title 17 Section 105 of the United States Code portions of this
# software authored by NIST employees are not subject to copyright
# protection and are in the public domain. For portions not authored
# by NIST employees, NIST has been granted unlimited rights. NIST
# assumes no responsibility whatsoever for its use by other parties,
# and makes no guarantees, expressed or implied, about its quality,
# reliability, or any other characteristic.
#
# We would appreciate acknowledgement if the software is used.
__version__="0.1.0"
import sys
import copy
import logging
import os
sys.path.append( os.path.join(os.path.dirname(__file__), "../.."))
import dfxml.objects as Objects
def get_brs():
logging.basicConfig(level=logging.DEBUG)
_logger = logging.getLogger(os.path.basename(__file__))
br = Objects.ByteRun()
br.file_offset = 4128
br.len = 133
brs = Objects.ByteRuns()
brs.append(br)
return brs
def test_all():
logging.basicConfig(level=logging.DEBUG)
_logger = logging.getLogger(os.path.basename(__file__))
brs = get_brs()
cbrs1 = copy.deepcopy(brs)
_logger.debug("brs = %r." % brs)
_logger.debug("cbrs1 = %r." % cbrs1)
assert cbrs1 == brs
cbrs1[0].file_offset += 133
_logger.debug("cbrs1 = %r." % cbrs1)
assert cbrs1 != brs
cbrs2 = copy.deepcopy(brs)
cbrs2[0].type = "unknown"
assert cbrs2 != brs