Skip to content

Commit 5dab47a

Browse files
committed
tests for Server object config_file, socket_path, socket_name
1 parent 2ea03a6 commit 5dab47a

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

tmuxp/testsuite/test_server.py

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import unittest
55
from random import randint
6-
from .. import Session, Window, Pane
6+
from .. import Server
77
from ..util import tmux
88
from .helpers import TmuxTestCase, TEST_SESSION_PREFIX
99
from . import t
@@ -14,42 +14,35 @@
1414
logger = logging.getLogger(__name__)
1515

1616

17-
# class NewServerTest(unittest.TestCase):
18-
class NewServerTest(TmuxTestCase):
19-
20-
def test_hi(self):
21-
self.assertEqual(2, 2)
22-
sessions = t._sessions
23-
24-
2517
class ServerTest(TmuxTestCase):
2618

2719
def test_has_session(self):
2820
self.assertTrue(t.has_session(self.TEST_SESSION_NAME))
2921
self.assertFalse(t.has_session('asdf2314324321'))
30-
logging.debug('wat')
31-
32-
def test_has_clients(self):
33-
pass
34-
35-
def test_has_sessions(self):
36-
pass
3722

38-
def test_socket(self):
39-
''' tmux allows the following configuration options for the server
23+
def test_socket_name(self):
24+
""" ``-L`` socket_name.
4025
4126
``-L`` socket_name file name of socket. which will be stored in
4227
env TMUX_TMPDIR or /tmp if unset.)
4328
44-
``-S`` socket_path (alternative path for server socket)
29+
"""
30+
myserver = Server(socket_name='test')
4531

46-
'''
47-
pass
32+
self.assertEqual(myserver.socket_name, 'test')
33+
34+
def test_socket_path(self):
35+
""" ``-S`` socket_path (alternative path for server socket). """
36+
37+
myserver = Server(socket_path='test')
38+
39+
self.assertEqual(myserver.socket_path, 'test')
4840

4941
def test_config(self):
50-
''' test whether passing a ``file`` into Server will alter the tmux
51-
options for server, session and windows '''
52-
pass
42+
""" ``-f`` file for tmux(1) configuration. """
43+
44+
myserver = Server(config_file='test')
45+
self.assertEqual(myserver.config_file, 'test')
5346

5447
if __name__ == '__main__':
5548
unittest.main()

0 commit comments

Comments
 (0)