Module EDTestCaseEDUtilsImage
|
|
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 __authors__ = ["Marie-Francoise Incardona", "Olof Svensson", "Jerome Kieffer"]
30 __contact__ = "svensson@esrf.eu"
31 __license__ = "LGPLv3+"
32 __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
33
34 import os
35
36 from EDVerbose import EDVerbose
37 from EDUtilsImage import EDUtilsImage
38 from EDTestCase import EDTestCase
39 from EDAssert import EDAssert
40
41
43
44
46 EDTestCase.__init__(self, _strTestName)
47 self.__edConfiguration = None
48 edStrDataDir = "images"
49 self.__edStrDataPath = os.path.join(self.getTestsDataHome(), edStrDataDir)
50 self.__strFileName = "ref-testscale_1_001.img"
51 self.__strFilePath = os.path.join(self.__edStrDataPath, self.__strFileName)
52
53
55 """
56 Testing retrieving the image number from a image filename
57 """
58 iImageNumber = EDUtilsImage.getImageNumber(self.__strFileName)
59 iReference = 1
60 EDAssert.equal(iReference, iImageNumber)
61
62
64 """
65 Testing retrieving the image number from a image filename
66 """
67 strSymbol = "#"
68 strTemplate = EDUtilsImage.getTemplate(self.__strFileName)
69 strTemplateReference = "ref-testscale_1_###.img"
70 EDAssert.equal(strTemplateReference, strTemplate)
71
72
74 """
75 Testing retrieving the image number from a image filename
76 """
77 strSymbol = "?"
78 strTemplate = EDUtilsImage.getTemplate(self.__strFileName, strSymbol)
79 strTemplateReference = "ref-testscale_1_???.img"
80 EDAssert.equal(strTemplateReference, strTemplate)
81
82
83
84
85
92
93
94
95
96
97 if __name__ == '__main__':
98
99 edTestCaseEDUtilsImage = EDTestCaseEDUtilsImage("TestCase EDTestCaseEDUtilsImage")
100 edTestCaseEDUtilsImage.execute()
101