Source

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

from Foundation import *
from PyObjCTools.TestSupport import *

class TestNSScriptWhoseTestsHelper (NSObject):
    def isEqualTo_(self, o): return 1
    def isLessThanOrEqualTo_(self, o): return 1
    def isLessThan_(self, o): return 1
    def isGreaterThanOrEqualTo_(self, o): return 1
    def isGreaterThan_(self, o): return 1
    def isNotEqualTo_(self, o): return 1
    def doesContain_(self, o): return 1
    def isLike_(self, o): return 1
    def isCaseInsensitiveLike_(self, o): return 1

    def scriptingIsEqualTo_(self, o): return 1
    def scriptingIsLessThanOrEqualTo_(self, o): return 1
    def scriptingIsLessThan_(self, o): return 1
    def scriptingIsGreaterThanOrEqualTo_(self, o): return 1
    def scriptingIsGreaterThan_(self, o): return 1
    def scriptingBeginsWith_(self, o): return 1
    def scriptingEndsWith_(self, o): return 1
    def scriptingContains_(self, o): return 1

class TestNSScriptWhoseTests (TestCase):

    def testConstants(self):
        self.assertEqual(NSEqualToComparison, 0)
        self.assertEqual(NSLessThanOrEqualToComparison, 1)
        self.assertEqual(NSLessThanComparison, 2)
        self.assertEqual(NSGreaterThanOrEqualToComparison, 3)
        self.assertEqual(NSGreaterThanComparison, 4)
        self.assertEqual(NSBeginsWithComparison, 5)
        self.assertEqual(NSEndsWithComparison, 6)
        self.assertEqual(NSContainsComparison, 7)


    def testMethods(self):
        self.assertResultIsBOOL(NSScriptWhoseTest.isTrue)

        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.isEqualTo_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.isLessThanOrEqualTo_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.isLessThan_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.isGreaterThanOrEqualTo_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.isGreaterThan_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.isNotEqualTo_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.doesContain_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.isLike_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.isCaseInsensitiveLike_)

        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.scriptingIsEqualTo_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.scriptingIsLessThanOrEqualTo_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.scriptingIsLessThan_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.scriptingIsGreaterThanOrEqualTo_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.scriptingIsGreaterThan_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.scriptingBeginsWith_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.scriptingEndsWith_)
        self.assertResultIsBOOL(TestNSScriptWhoseTestsHelper.scriptingContains_)

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.