Skip to content

Commit

Permalink
Remove sanity check method for now
Browse files Browse the repository at this point in the history
updated tests

Updated version
  • Loading branch information
Milind Shakya committed Apr 10, 2015
1 parent b405f2e commit 1854ea8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

setup(
name='tmuxipy',
version='0.1.9',
version='0.1.10',
description="Manage Tmux sessions legitly",
long_description=readme + '\n\n' + history,
author="Milind Shakya",
Expand Down
7 changes: 0 additions & 7 deletions tests/test_tmux_session_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,12 @@ def test__init(self):
self.assertEqual({}, session_a.windows)

@mock.patch(TESTING_MODULE + '.Window')
@mock.patch.object(Session, '_sanity_check')
@mock.patch.object(Session, '_execute_pre_commands')
@mock.patch.object(Session, '_attach_to_session')
def test_create(self,
mock__attach_to_session,
mock__execute_pre_commands,
mock__sanity_check,
mock_window):
self.session.create()
mock__sanity_check.assert_called_once_with()
mock__execute_pre_commands.assert_called_once_with()
mock__attach_to_session.assert_called_once_with()




12 changes: 1 addition & 11 deletions tmuxipy/tmux_session_builder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import random

from blessings import Terminal

Expand All @@ -18,7 +19,6 @@ def __init__(self, name, config, tmux):
self.windows = {}

def create(self):
self._sanity_check()
self._execute_pre_commands()
for win_num, window in enumerate(self.config.get('windows')):
win = Window(
Expand All @@ -44,16 +44,6 @@ def _execute_pre_commands(self):
pre_cmds = self.config.get('pre')
map(_execute, pre_cmds)

def _sanity_check(self):
"""
Currently Checks to see if a tmux session with the current session
name already exists.
"""
stdout = _execute('tmux ls', capture=True)
if self.name in stdout:
print t.bold_red('Session name: {} already exists'.format(self.name))
sys.exit()


class Window(object):

Expand Down

0 comments on commit 1854ea8

Please sign in to comment.