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)"' )
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)"' )
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'))
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'))
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"))
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)
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")
def test_install_assistive_bundle(): """ Test installing a bundle ID as being allowed to run with assistive access """ assert assistive.install("foo")
def test_remove_assistive(): """ Test removing an assitive bundle. """ assistive.install("foo") assert assistive.remove("foo")
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")
def test_enabled_assistive(): """ Test enabling a bundle ID as being allowed to run with assistive access """ assistive.install("foo") assert assistive.enabled("foo")