|
3 | 3 |
|
4 | 4 | import unittest |
5 | 5 | from random import randint |
6 | | -from .. import Session, Window, Pane |
| 6 | +from .. import Server |
7 | 7 | from ..util import tmux |
8 | 8 | from .helpers import TmuxTestCase, TEST_SESSION_PREFIX |
9 | 9 | from . import t |
|
14 | 14 | logger = logging.getLogger(__name__) |
15 | 15 |
|
16 | 16 |
|
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 | | - |
25 | 17 | class ServerTest(TmuxTestCase): |
26 | 18 |
|
27 | 19 | def test_has_session(self): |
28 | 20 | self.assertTrue(t.has_session(self.TEST_SESSION_NAME)) |
29 | 21 | 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 |
37 | 22 |
|
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. |
40 | 25 |
|
41 | 26 | ``-L`` socket_name file name of socket. which will be stored in |
42 | 27 | env TMUX_TMPDIR or /tmp if unset.) |
43 | 28 |
|
44 | | - ``-S`` socket_path (alternative path for server socket) |
| 29 | + """ |
| 30 | + myserver = Server(socket_name='test') |
45 | 31 |
|
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') |
48 | 40 |
|
49 | 41 | 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') |
53 | 46 |
|
54 | 47 | if __name__ == '__main__': |
55 | 48 | unittest.main() |
0 commit comments