aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_gsd.py
blob: 1fc58c8d575b90d641663888e92becc4bcc3cd5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from __future__ import division, absolute_import, print_function, unicode_literals
from pyprofibus_tstlib import *
initTest(__file__)

import pyprofibus


class Test_GSD(TestCase):
	def test_gsdinterp(self):
		gsd = pyprofibus.GsdInterp.fromFile("dummy.gsd")
		gsd.setConfiguredModule("dummy input module")
		gsd.setConfiguredModule("dummy output module")

		self.assertEqual([ e.getDU()
					for e in gsd.getCfgDataElements() ],
				 [ [0x00, ], [0x10, ], [0x20, ], ])
		self.assertEqual(gsd.getIdentNumber(), 0x4224)
		self.assertEqual(gsd.getUserPrmData(), bytearray([0x00, 0x00, 0x00, 0x42]))
bues.ch cgit interface