|
19 | 19 |
|
20 | 20 | import unittest |
21 | 21 |
|
22 | | -from diffpy.pdfgui.control.controlerrors import ControlRuntimeError |
23 | | -from diffpy.pdfgui.tests.testutils import datafile |
| 22 | +from diffpy.pdfgui.control.pdfguicontrol import PDFGuiControl |
24 | 23 |
|
| 24 | +# ---------------------------------------------------------------------------- |
25 | 25 |
|
26 | | -############################################################################## |
27 | 26 | class TestPDFGuiControl(unittest.TestCase): |
28 | 27 | """test methods of PDFGuiControl""" |
29 | 28 |
|
30 | 29 | def setUp(self): |
31 | | - from diffpy.pdfgui.control.pdfguicontrol import PDFGuiControl |
32 | 30 | self.control = PDFGuiControl() |
33 | 31 | return |
34 | 32 |
|
35 | 33 | def tearDown(self): |
36 | 34 | del self.control |
37 | 35 | return |
38 | 36 |
|
39 | | - @unittest.skip("feature planned for removal") |
40 | | - def test_importPdffit2Script(self): |
41 | | - """check PDFGuiControl.importPdffit2Script() |
42 | | - """ |
43 | | - self.assertEqual(0, len(self.control.fits)) |
44 | | - fgoodNi = datafile('goodNiScript.py') |
45 | | - ftwophases = datafile('CdSe15_twophases.py') |
46 | | - fbadNi1 = datafile('badNiScript1.py') |
47 | | - fbadNi2 = datafile('badNiScript2.py') |
48 | | - newfits = self.control.importPdffit2Script(fgoodNi) |
49 | | - self.assertEqual(1, len(newfits)) |
50 | | - self.assertEqual(1, len(self.control.fits)) |
51 | | - newfits = self.control.importPdffit2Script(ftwophases) |
52 | | - self.assertEqual(5, len(newfits)) |
53 | | - self.assertEqual(6, len(self.control.fits)) |
54 | | - self.assertRaises(ControlRuntimeError, |
55 | | - self.control.importPdffit2Script, fbadNi1) |
56 | | - self.assertRaises(ControlRuntimeError, |
57 | | - self.control.importPdffit2Script, fbadNi2) |
| 37 | + |
| 38 | + def test___init__(self): |
| 39 | + "check PDFGuiControl.__init__" |
| 40 | + self.assertEqual('', self.control.journal) |
| 41 | + self.assertIsNone(self.control.projfile) |
58 | 42 | return |
59 | 43 |
|
60 | 44 | # End of class TestPDFGuiControl |
61 | 45 |
|
| 46 | +# ---------------------------------------------------------------------------- |
| 47 | + |
62 | 48 | if __name__ == '__main__': |
63 | 49 | unittest.main() |
64 | 50 |
|
|
0 commit comments