Source

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

from PyObjCTools.TestSupport import *
from AppKit import *

class TestNSTokenFieldCellHelper (NSObject):
    def tokenFieldCell_completionsForSubstring_indexOfToken_indexOfSelectedItem_(self, a, b, c, d): return 1
    def tokenFieldCell_shouldAddObjects_atIndex_(self, a, b, c): return 1
    def tokenFieldCell_writeRepresentedObjects_toPasteboard_(self, a, b, c): return 1
    def tokenFieldCell_hasMenuForRepresentedObject_(self, a, b): return 1
    def tokenFieldCell_styleForRepresentedObject_(self, a, b): return 1


class TestNSTokenFieldCell (TestCase):
    def testConstants(self):
        self.assertEqual(NSDefaultTokenStyle, 0)
        self.assertEqual(NSPlainTextTokenStyle, 1)
        self.assertEqual(NSRoundedTokenStyle, 2)

    def testProtocols(self):
        self.assertArgHasType(TestNSTokenFieldCellHelper.tokenFieldCell_completionsForSubstring_indexOfToken_indexOfSelectedItem_, 2, objc._C_NSInteger)
        self.assertArgHasType(TestNSTokenFieldCellHelper.tokenFieldCell_completionsForSubstring_indexOfToken_indexOfSelectedItem_, 3, b'o^'+ objc._C_NSInteger)
        self.assertArgHasType(TestNSTokenFieldCellHelper.tokenFieldCell_shouldAddObjects_atIndex_, 2, objc._C_NSUInteger)
        self.assertResultIsBOOL(TestNSTokenFieldCellHelper.tokenFieldCell_writeRepresentedObjects_toPasteboard_)
        self.assertResultIsBOOL(TestNSTokenFieldCellHelper.tokenFieldCell_hasMenuForRepresentedObject_)
        self.assertResultHasType(TestNSTokenFieldCellHelper.tokenFieldCell_styleForRepresentedObject_, objc._C_NSUInteger)

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.