Source

pyobjc / pyobjc-framework-Cocoa / PyObjCTest / test_nsfontcollection.py

from PyObjCTools.TestSupport import *

import AppKit

try:
    unicode
except NameError:
    unicode = str

class TestNSFontCollection (TestCase):
    @min_os_level('10.7')
    def testConstants10_7(self):
        self.assertEqual(AppKit.NSFontCollectionVisibilityProcess, 1)
        self.assertEqual(AppKit.NSFontCollectionVisibilityUser, 2)
        self.assertEqual(AppKit.NSFontCollectionVisibilityComputer, 4)

        self.assertIsInstance(AppKit.NSFontCollectionIncludeDisabledFontsOption, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionRemoveDuplicatesOption, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionDisallowAutoActivationOption, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionDidChangeNotification, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionActionKey, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionNameKey, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionOldNameKey, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionVisibilityKey, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionWasShown, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionWasHidden, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionWasRenamed, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionAllFonts, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionUser, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionFavorites, unicode)
        self.assertIsInstance(AppKit.NSFontCollectionRecentlyUsed, unicode)

    @min_os_level('10.7')
    def testMethods10_7(self):
        self.assertResultIsBOOL(AppKit.NSFontCollection.showFontCollection_withName_visibility_error_)
        self.assertArgIsOut(AppKit.NSFontCollection.showFontCollection_withName_visibility_error_, 3)
        self.assertResultIsBOOL(AppKit.NSFontCollection.hideFontCollectionWithName_visibility_error_)
        self.assertArgIsOut(AppKit.NSFontCollection.hideFontCollectionWithName_visibility_error_, 2)

        self.assertResultIsBOOL(AppKit.NSFontCollection.renameFontCollectionWithName_visibility_toName_error_)
        self.assertArgIsOut(AppKit.NSFontCollection.renameFontCollectionWithName_visibility_toName_error_, 3)

if __name__ == "__main__":
    main()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.