Commits

Ronald Oussoren  committed 8b86cea

Test that some functions actually aren't present on platforms where the C function isn't available

  • Participants
  • Parent commits 159fd0b

Comments (0)

Files changed (2)

File asl_tests/test_client.py

         msg[asl.ASL_KEY_FACILITY] = "com.apple.console"
         cli.log_descriptor(msg, asl.ASL_LEVEL_NOTICE, fd, asl.ASL_LOG_DESCRIPTOR_WRITE)
 
+    @unittest.skipUnless(platform.mac_ver()[0] < "10.8", "Requires OSX 10.8")
+    def test_no_redirection(self):
+        cli = asl.aslclient("ident", "facility", 0)
+        self.assertIsInstance(cli, asl.aslclient)
+
+        self.assertFalse(hasattr(cli, 'log_descriptor'))
+
     @unittest.skipUnless(platform.mac_ver()[0] >= "10.7", "Requires OSX 10.7")
     def test_open_from_file(self):
         try:
             if os.path.exists("asl.log"):
                 os.unlink("asl.log")
 
+    @unittest.skipUnless(platform.mac_ver()[0] < "10.7", "Requires OSX 10.7")
+    def test_no_open_from_file(self):
+        self.assertFalse(hasattr(asl, 'open_from_file'))
+
 if __name__ == "__main__":
     unittest.main()

File asl_tests/test_misc.py

 import unittest
+import platform
 
 import asl
 
         self.assertIs(asl.asl_new, asl.aslmsg)
         self.assertIs(asl.asl_open, asl.aslclient)
 
+
+    @unittest.skipUnless(platform.mac_ver()[0] < "10.7", "Requires OSX 10.7")
+    def test_no_aux(self):
+        self.assertFalse(hasattr(asl, 'create_auxiliary_file'))
+        self.assertFalse(hasattr(asl, 'close_auxiliary_file'))
+        self.assertFalse(hasattr(asl, 'log_auxiliary_location'))
+
     @unittest.skipUnless(platform.mac_ver()[0] >= "10.7", "Requires OSX 10.7")
     def test_create_auxiliary_file(self):
         self.fail()