Skip to content

Commit 603997c

Browse files
committed
Fix duplicate names of test methods.
It was not executed at all due to duplicate name.
1 parent 9f6a6de commit 603997c

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

diffpy/srfit/tests/testprofile.py

+14-16
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def testSetObservedProfile(self):
7373

7474
return
7575

76+
7677
def testSetCalculationRange(self):
7778
"""Test the setCalculationRange method."""
7879
x = arange(2, 10, 0.5)
@@ -101,48 +102,45 @@ def testSetCalculationRange(self):
101102
prof.setCalculationRange(xmin = 0)
102103
self.assertTrue( array_equal(x, prof.x) )
103104
self.assertTrue( array_equal(y, prof.y) )
104-
self.assertTrue( array_equal(dy, dprof.y) )
105+
self.assertTrue( array_equal(dy, prof.dy) )
105106

106107
# Test an upper bound > xmax
107108
prof.setCalculationRange(xmax = 100)
108-
prof.x, prof.y, dprof.y = prof.getRangedProfile()
109109
self.assertTrue( array_equal(x, prof.x) )
110110
self.assertTrue( array_equal(y, prof.y) )
111-
self.assertTrue( array_equal(dy, dprof.y) )
111+
self.assertTrue( array_equal(dy, prof.dy) )
112112

113113
# Test xmin > xmax
114-
self.assertRaises(ValueError, profile.setCalculationRange, xmin = 10,
114+
self.assertRaises(ValueError, prof.setCalculationRange, xmin = 10,
115115
xmax = 3)
116116

117117
# Test xmax - xmin < dx
118-
self.assertRaises(ValueError, profile.setCalculationRange, xmin = 3,
118+
self.assertRaises(ValueError, prof.setCalculationRange, xmin = 3,
119119
xmax = 3 + 0.4, dx = 0.5)
120120

121121
# Test dx <= 0
122-
self.assertRaises(ValueError, profile.setCalculationRange, dx = 0)
123-
self.assertRaises(ValueError, profile.setCalculationRange, dx =
122+
self.assertRaises(ValueError, prof.setCalculationRange, dx = 0)
123+
self.assertRaises(ValueError, prof.setCalculationRange, dx =
124124
-0.000001)
125125
# This should be alright
126-
profile.setCalculationRange(dx = 0.000001)
126+
prof.setCalculationRange(dx = 0.000001)
127127

128128
# Test an internal bound
129129
prof.setCalculationRange(4, 7)
130-
prof.x, prof.y, dprof.y = prof.getRangedProfile()
131130
self.assertTrue( array_equal(prof.x, arange(4, 7.5, 0.5) ) )
132131
self.assertTrue( array_equal(prof.y, arange(4, 7.5, 0.5) ) )
133-
self.assertTrue( array_equal(dprof.y, arange(4, 7.5, 0.5) ) )
132+
self.assertTrue( array_equal(prof.y, arange(4, 7.5, 0.5) ) )
134133

135134
# Test a new grid
136135
prof.setCalculationRange(4, 7, 0.1)
137-
prof.x, prof.y, dprof.y = prof.getRangedProfile()
138136
self.assertTrue( array_equal(prof.x, arange(4, 7.1, 0.1) ) )
139-
self.assertAlmostEqual( 0, sum(prof.y- arange(4, 7.1, 0.1))**2 )
140-
self.assertAlmostEqual( 0, sum(dprof.y- arange(4, 7.1, 0.1))**2 )
141-
137+
self.assertAlmostEqual( 0, sum(prof.y - arange(4, 7.1, 0.1))**2 )
138+
self.assertAlmostEqual( 0, sum(prof.y - arange(4, 7.1, 0.1))**2 )
142139
return
143140

144-
def testSetCalculationRange(self):
145-
"""Test the setCalculationRange method."""
141+
142+
def testSetCalculationPoints(self):
143+
"""Test the setCalculationPoints method."""
146144
prof = self.profile
147145

148146
x = arange(2, 10.5, 0.5)

0 commit comments

Comments
 (0)