def test_update_rc_files_with_nonexistent_path(self): """ Test an unhappy path if the bashrc/users do not exist. """ p = [Path('/home/deadbeefdoesnotexist/.bashrc')] with pytest.raises(OSError) as exinfo: install.update_rc_files(['test1', 'test2'], rc_files=p)
def test_update_rc_files(self, pmock): """ Test happy path on updating env files. Assuming everything exists and is in place. """ pmock.return_value.lines.return_value = ['line1', 'line2'] install.update_rc_files(['test1', 'test2']) pmock.return_value.write_lines.assert_called_with( ['line1', 'line2', 'test1', 'test2'])
def test_update_rc_files(self, pmock): """ Test happy path on updating env files. Assuming everything exists and is in place. """ pmock.return_value.lines.return_value = ['line1', 'line2'] install.update_rc_files(['test1', 'test2']) pmock.return_value.write_lines.assert_called_with(['line1', 'line2', 'test1', 'test2'])
def test_update_rc_files_with_nonexistent_path(self): """ Test an unhappy path if the bashrc/users do not exist. """ with pytest.raises(OSError) as exinfo: install.update_rc_files(['test1', 'test2'])
def test_update_rc_files_with_nonexistant_path(self): """ Test an unhappy path if the bashrc/users do not exist. """ with pytest.raises(OSError) as exinfo: install.update_rc_files(['test1','test2'])