Source

pyobjc / pyobjc-framework-SystemConfiguration / PyObjCTest / test_SCDynamicStoreKey.py

from PyObjCTools.TestSupport import *

from SystemConfiguration import *

try:
    unicode
except NameError:
    unicode = str

class TestSCDynamicStoreKey (TestCase):
    def testFunctions(self):

        r = SCDynamicStoreKeyCreate(None, "Setup:/%s/%d", b"PyObjC", 9)
        self.assertTrue(isinstance(r, unicode))
        self.assertEquals(r, b"Setup:/PyObjC/9".decode('latin1'))

        r = SCDynamicStoreKeyCreateNetworkGlobalEntity(None,
                kSCDynamicStoreDomainSetup, kSCEntNetDNS)
        self.assertTrue(isinstance(r, unicode))

        r = SCDynamicStoreKeyCreateNetworkInterface(None, kSCDynamicStoreDomainState)
        self.assertTrue(isinstance(r, unicode))

        r = SCDynamicStoreKeyCreateNetworkInterfaceEntity(None,
                kSCDynamicStoreDomainState, "en0", kSCEntNetIPv4)
        self.assertTrue(isinstance(r, unicode))

        r = SCDynamicStoreKeyCreateNetworkServiceEntity(None,
                kSCDynamicStoreDomainState, "ssh", kSCEntNetDNS)
        self.assertTrue(isinstance(r, unicode))

        r = SCDynamicStoreKeyCreateComputerName(None)
        self.assertTrue(isinstance(r, unicode))

        r = SCDynamicStoreKeyCreateConsoleUser(None)
        self.assertTrue(isinstance(r, unicode))

        r = SCDynamicStoreKeyCreateHostNames(None)
        self.assertTrue(isinstance(r, unicode))

        r = SCDynamicStoreKeyCreateLocation(None)
        self.assertTrue(isinstance(r, unicode))

        r = SCDynamicStoreKeyCreateProxies(None)
        self.assertTrue(isinstance(r, unicode))

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.