コード例 #1
0
 def test_install_assistive_command(self):
     '''
         Test installing a command as being allowed to run with assistive access
     '''
     mock = MagicMock()
     with patch.dict(assistive.__salt__, {'cmd.run': mock}):
         assistive.install('/usr/bin/osascript')
         mock.assert_called_once_with(
             'sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" '
             '"INSERT or REPLACE INTO access '
             'VALUES(\'kTCCServiceAccessibility\',\'/usr/bin/osascript\',1,1,1,NULL)"'
         )
コード例 #2
0
 def test_install_assistive_bundle_disable(self):
     '''
         Test installing a bundle ID as being allowed to run with assistive access
     '''
     mock = MagicMock()
     with patch.dict(assistive.__salt__, {'cmd.run': mock}):
         assistive.install('com.apple.Chess', False)
         mock.assert_called_once_with(
             'sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" '
             '"INSERT or REPLACE INTO access '
             'VALUES(\'kTCCServiceAccessibility\',\'com.apple.Chess\',0,0,1,NULL)"'
         )
コード例 #3
0
 def test_install_assistive_bundle(self):
     '''
     Test installing a bundle ID as being allowed to run with assistive access
     '''
     mock_ret = MagicMock(return_value={'retcode': 0})
     with patch.dict(assistive.__salt__, {'cmd.run_all': mock_ret}):
         self.assertTrue(assistive.install('foo'))
コード例 #4
0
ファイル: mac_assistive_test.py プロジェクト: bryson/salt
 def test_install_assistive_bundle(self):
     '''
     Test installing a bundle ID as being allowed to run with assistive access
     '''
     mock_ret = MagicMock(return_value={'retcode': 0})
     with patch.dict(assistive.__salt__, {'cmd.run_all': mock_ret}):
         with patch.dict(assistive.__grains__, {'osrelease': '10.11.3'}):
             self.assertTrue(assistive.install('foo'))
コード例 #5
0
 def test_install_assistive_bundle(self):
     """
     Test installing a bundle ID as being allowed to run with assistive access
     """
     mock_ret = MagicMock(return_value={"retcode": 0})
     with patch.dict(assistive.__salt__, {"cmd.run_all": mock_ret}):
         with patch.dict(assistive.__grains__, {"osrelease": "10.11.3"}):
             self.assertTrue(assistive.install("foo"))
コード例 #6
0
def test_enable_assistive():
    """
    Test enabling a bundle ID as being allowed to run with assistive access
    """
    assistive.install("foo", enable=False)
    assert assistive.enable_("foo", True)
コード例 #7
0
def test_installed_bundle():
    """
    Test checking to see if a bundle id is installed as being able to use assistive access
    """
    assistive.install("foo")
    assert assistive.installed("foo")
コード例 #8
0
def test_install_assistive_bundle():
    """
    Test installing a bundle ID as being allowed to run with assistive access
    """
    assert assistive.install("foo")
コード例 #9
0
def test_remove_assistive():
    """
    Test removing an assitive bundle.
    """
    assistive.install("foo")
    assert assistive.remove("foo")
コード例 #10
0
def test_enabled_assistive_false():
    """
    Test if a bundle ID is disabled for assistive access
    """
    assistive.install("foo", enable=False)
    assert not assistive.enabled("foo")
コード例 #11
0
def test_enabled_assistive():
    """
    Test enabling a bundle ID as being allowed to run with assistive access
    """
    assistive.install("foo")
    assert assistive.enabled("foo")