1
2from PyObjCTools.TestSupport import *
3from AppKit import *
4
5try:
6    unicode
7except NameError:
8    unicode = str
9
10class TestNSPrintPanel (TestCase):
11
12    def testConstants(self):
13        self.assertEqual(NSPrintPanelShowsCopies, 0x01)
14        self.assertEqual(NSPrintPanelShowsPageRange, 0x02)
15        self.assertEqual(NSPrintPanelShowsPaperSize, 0x04)
16        self.assertEqual(NSPrintPanelShowsOrientation, 0x08)
17        self.assertEqual(NSPrintPanelShowsScaling, 0x10)
18        self.assertEqual(NSPrintPanelShowsPageSetupAccessory, 0x100)
19        self.assertEqual(NSPrintPanelShowsPreview, 0x20000)
20
21        self.assertIsInstance(NSPrintPhotoJobStyleHint, unicode)
22
23    @min_os_level('10.5')
24    def testConstants10_5(self):
25        self.assertIsInstance(NSPrintPanelAccessorySummaryItemNameKey, unicode)
26        self.assertIsInstance(NSPrintPanelAccessorySummaryItemDescriptionKey, unicode)
27
28    def testMethods(self):
29        self.assertArgIsSEL(NSPrintPanel.beginSheetWithPrintInfo_modalForWindow_delegate_didEndSelector_contextInfo_, 3, b'v@:@' + objc._C_NSInteger + b'^v')
30        self.assertArgHasType(NSPrintPanel.beginSheetWithPrintInfo_modalForWindow_delegate_didEndSelector_contextInfo_, 4, b'^v')
31
32    @min_os_level('10.6')
33    def testConstants10_6(self):
34        self.assertEqual(NSPrintPanelShowsPrintSelection, 1 << 5)
35
36        self.assertIsInstance(NSPrintAllPresetsJobStyleHint, unicode)
37        self.assertIsInstance(NSPrintNoPresetsJobStyleHint, unicode)
38
39
40if __name__ == "__main__":
41    main()
42