コード例 #1
0
    def test_add_usr_local_bin_raises_exception_on_failure(
            self, *args, **kwargs):
        # force an exception by removing /etc/profile.d
        sudo('rm -rf /etc/profile.d')

        with self.assertRaises(SystemExit) as cm:
            os_helpers.add_usr_local_bin_to_path()
        self.assertEqual(cm.exception.code, 1)
コード例 #2
0
ファイル: test_os.py プロジェクト: ClusterHQ/bookshelf
    def test_add_usr_local_bin_raises_exception_on_failure(self, *args,
                                                           **kwargs):
        # force an exception by removing /etc/profile.d
        sudo('rm -rf /etc/profile.d')

        with self.assertRaises(SystemExit) as cm:
            os_helpers.add_usr_local_bin_to_path()
        self.assertEqual(cm.exception.code, 1)
コード例 #3
0
 def test_add_user_local_bin_returns_True_on_success(self, *args, **kwargs):
     self.assertTrue(os_helpers.add_usr_local_bin_to_path())
コード例 #4
0
 def test_add_usr_local_bin_to_path_updates_PATH(self, *args, **kwargs):
     os_helpers.add_usr_local_bin_to_path()
     self.assertTrue('/usr/local/bin' in sudo('echo $PATH'))
コード例 #5
0
ファイル: test_os.py プロジェクト: ClusterHQ/bookshelf
 def test_add_user_local_bin_returns_True_on_success(self, *args, **kwargs):
     self.assertTrue(os_helpers.add_usr_local_bin_to_path())
コード例 #6
0
ファイル: test_os.py プロジェクト: ClusterHQ/bookshelf
 def test_add_usr_local_bin_to_path_updates_PATH(self, *args, **kwargs):
     os_helpers.add_usr_local_bin_to_path()
     self.assertTrue('/usr/local/bin' in sudo('echo $PATH'))