1 2from PyObjCTools.TestSupport import * 3from AppKit import * 4 5class TestNSSoundHelper (NSObject): 6 def sound_didFinishPlaying_(self, s, p): pass 7 8 9class TestNSSound (TestCase): 10 def testConstants(self): 11 self.assertIsInstance(NSSoundPboardType, unicode) 12 13 def testMethods(self): 14 self.assertArgIsBOOL(NSSound.initWithContentsOfURL_byReference_, 1) 15 self.assertArgIsBOOL(NSSound.initWithContentsOfFile_byReference_, 1) 16 self.assertResultIsBOOL(NSSound.setName_) 17 self.assertResultIsBOOL(NSSound.canInitWithPasteboard_) 18 self.assertResultIsBOOL(NSSound.play) 19 self.assertResultIsBOOL(NSSound.pause) 20 self.assertResultIsBOOL(NSSound.resume) 21 self.assertResultIsBOOL(NSSound.stop) 22 self.assertResultIsBOOL(NSSound.isPlaying) 23 self.assertResultIsBOOL(NSSound.loops) 24 self.assertArgIsBOOL(NSSound.setLoops_, 0) 25 26 def testProtocols(self): 27 self.assertArgIsBOOL(TestNSSoundHelper.sound_didFinishPlaying_, 1) 28 29if __name__ == "__main__": 30 main() 31