Skip to content

Commit 760b602

Browse files
committed
PEP257
1 parent 3930bd8 commit 760b602

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed

tmuxp/testsuite/test_config_tmuxinator.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,14 @@ def test_config_to_dict(self):
9494

9595
class TmuxinatorDeprecationsTest(TestCase):
9696

97-
""" tmuxinator uses `tabs` instead of `windows` in older versions
97+
"""Tmuxinator uses `tabs` instead of `windows` in older versions.
9898
9999
https://github.com/aziz/tmuxinator/blob/master/lib/tmuxinator/project.rb#L18
100100
101101
https://github.com/aziz/tmuxinator/blob/master/spec/fixtures/sample.deprecations.yml
102102
103103
LICENSE: https://github.com/aziz/tmuxinator/blob/master/LICENSE
104+
104105
"""
105106

106107
tmuxinator_yaml = """\
@@ -149,7 +150,10 @@ class TmuxinatorDeprecationsTest(TestCase):
149150
{
150151
'editor': {
151152
'pre': [
152-
'echo "I get run in each pane, before each pane command!"',
153+
(
154+
'echo "I get run in each pane,',
155+
'before each pane command!"'
156+
),
153157
None
154158
],
155159
'layout': 'main-vertical',
@@ -279,9 +283,12 @@ def test_config_to_dict(self):
279283

280284
class TmuxinatoriSampleTest(TestCase):
281285

282-
"""https://github.com/aziz/tmuxinator/blob/master/spec/fixtures/sample.yml
286+
"""Tests against tmuxinator's <spec/fixtures/sample.yml>.
287+
288+
https://github.com/aziz/tmuxinator/blob/master/spec/fixtures/sample.yml
283289
284290
LICENSE: https://github.com/aziz/tmuxinator/blob/master/LICENSE
291+
285292
"""
286293

287294
tmuxinator_yaml = """\
@@ -335,7 +342,10 @@ class TmuxinatoriSampleTest(TestCase):
335342
{
336343
'editor': {
337344
'pre': [
338-
'echo "I get run in each pane, before each pane command!"',
345+
(
346+
'echo "I get run in each pane, ',
347+
'before each pane command!"'
348+
),
339349
None
340350
],
341351
'layout': 'main-vertical',

tmuxp/testsuite/test_server.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,3 @@ def test_88_colors(self):
6868

6969
self.assertIn('-8', proc.cmd)
7070
self.assertNotIn('-2', proc.cmd)
71-
72-
if __name__ == '__main__':
73-
unittest.main()

tmuxp/testsuite/test_session.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,17 @@
2626
class SessionTest(TmuxTestCase):
2727

2828
def test_has_session(self):
29-
"""Server.has_session returns True if has session_name exists"""
29+
"""Server.has_session returns True if has session_name exists."""
3030
self.assertTrue(t.has_session(self.TEST_SESSION_NAME))
3131
self.assertFalse(t.has_session('asdf2314324321'))
3232

3333
def test_select_window(self):
34-
"""Session.select_window moves window"""
34+
"""Session.select_window moves window."""
3535
# get the current window_base_index, since different user tmux config
3636
# may start at 0 or 1, or whatever they want.
3737
window_base_index = int(
38-
self.session.attached_window().get('window_index'))
38+
self.session.attached_window().get('window_index')
39+
)
3940

4041
window = self.session.new_window(window_name='test_window')
4142
window_count = len(self.session._windows)
@@ -67,7 +68,7 @@ def test_select_window(self):
6768
selected_window1.__dict__, selected_window2.__dict__)
6869

6970
def test_select_window_returns_Window(self):
70-
"""Session.select_window returns Window object"""
71+
"""Session.select_window returns Window object."""
7172

7273
window_count = len(self.session._windows)
7374
self.assertEqual(len(self.session._windows), window_count)
@@ -78,15 +79,15 @@ def test_select_window_returns_Window(self):
7879
window_base_index), Window)
7980

8081
def test_attached_window(self):
81-
"""Session.attached_window() returns Window"""
82+
"""Session.attached_window() returns Window."""
8283
self.assertIsInstance(self.session.attached_window(), Window)
8384

8485
def test_attached_pane(self):
85-
"""Session.attached_pane() returns Pane"""
86+
"""Session.attached_pane() returns Pane."""
8687
self.assertIsInstance(self.session.attached_pane(), Pane)
8788

8889
def test_session_rename(self):
89-
"""Session.rename_session renames session"""
90+
"""Session.rename_session renames session."""
9091
test_name = 'testingdis_sessname'
9192
self.session.rename_session(test_name)
9293
self.assertEqual(self.session.get('session_name'), test_name)
@@ -100,7 +101,7 @@ def test_session_rename(self):
100101
class SessionNewTest(TmuxTestCase):
101102

102103
def test_new_session(self):
103-
"""Server.new_session creates new session"""
104+
"""Server.new_session creates new session."""
104105
new_session_name = TEST_SESSION_PREFIX + str(randint(0, 1337))
105106
new_session = t.new_session(session_name=new_session_name, detach=True)
106107

@@ -117,8 +118,7 @@ def test_show_options(self):
117118
self.assertIsInstance(options, dict)
118119

119120
def test_set_show_options_single(self):
120-
"""Set option then Session.show_options(key)
121-
"""
121+
"""Set option then Session.show_options(key)."""
122122

123123
self.session.set_option('history-limit', 20)
124124
self.assertEqual(20, self.session.show_options('history-limit'))
@@ -129,8 +129,7 @@ def test_set_show_options_single(self):
129129
self.assertEqual(40, self.session.show_options()['history-limit'])
130130

131131
def test_set_show_option(self):
132-
"""Set option then Session.show_option(key)
133-
"""
132+
"""Set option then Session.show_option(key)."""
134133
self.session.set_option('history-limit', 20)
135134
self.assertEqual(20, self.session.show_option('history-limit'))
136135

@@ -139,6 +138,6 @@ def test_set_show_option(self):
139138
self.assertEqual(40, self.session.show_option('history-limit'))
140139

141140
def test_set_option_bad(self):
142-
"""Session.set_option raises ValueError for bad option key"""
141+
"""Session.set_option raises ValueError for bad option key."""
143142
with self.assertRaises(ValueError):
144143
self.session.set_option('afewewfew', 43)

0 commit comments

Comments
 (0)