Beispiel #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)
Beispiel #2
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)
Beispiel #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())
Beispiel #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'))
Beispiel #5
0
 def test_add_user_local_bin_returns_True_on_success(self, *args, **kwargs):
     self.assertTrue(os_helpers.add_usr_local_bin_to_path())
Beispiel #6
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'))