| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | 8 | from __future__ import unicode_literals | |
| 9 | 9 | ||
| 10 | + | ||
| 10 | 11 | class Error(Exception): | |
| 11 | 12 | pass | |
| 12 | 13 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,7 +66,7 @@ def __exit__(self, exc_type, exc_value, traceback): | |||
| 66 | 66 | ||
| 67 | 67 | def logout(self, suppress_errors=False): | |
| 68 | 68 | '''Log out of session | |
| 69 | - | ||
| 69 | + | ||
| 70 | 70 | :param suppress_errors: boolean, whether to not raise an error if we | |
| 71 | 71 | already were logged out. | |
| 72 | 72 | ''' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,6 @@ def setUp(self): | |||
| 30 | 30 | ||
| 31 | 31 | self.session = webuntis.Session() | |
| 32 | 32 | ||
| 33 | - | ||
| 34 | 33 | def tearDown(self): | |
| 35 | 34 | self.request_patcher.stop() | |
| 36 | 35 | self.session = None | |
@@ -69,7 +68,6 @@ def test_options_values(self): | |||
| 69 | 68 | raise Exception('Expected that OptionStore.values is a \ | |
| 70 | 69 | dictionary') | |
| 71 | 70 | ||
| 72 | - | ||
| 73 | 71 | def test_getdepartments_mock(self): | |
| 74 | 72 | jsonstr = json.load( | |
| 75 | 73 | open(self.data_path + '/getdepartments_mock.json') | |
@@ -164,7 +162,6 @@ def test_gettimetables_mock(self): | |||
| 164 | 162 | period_raw['endTime'] | |
| 165 | 163 | ) | |
| 166 | 164 | ||
| 167 | - | ||
| 168 | 165 | def test_getrooms_mock(self): | |
| 169 | 166 | jsonstr = json.load( | |
| 170 | 167 | open(self.data_path + '/getrooms_mock.json') | |
@@ -179,7 +176,6 @@ def test_getrooms_mock(self): | |||
| 179 | 176 | self.assertEqual(room_raw['name'], room.name) | |
| 180 | 177 | self.assertEqual(room_raw['id'], room.id) | |
| 181 | 178 | ||
| 182 | - | ||
| 183 | 179 | def test_getschoolyears_mock(self): | |
| 184 | 180 | jsonstr = json.load( | |
| 185 | 181 | open(self.data_path + '/getschoolyears_mock.json') | |
@@ -215,7 +211,6 @@ def test_getsubjects_mock(self): | |||
| 215 | 211 | self.assertEqual(subj_raw['longName'], subj.long_name) | |
| 216 | 212 | self.assertEqual(subj_raw['name'], subj.name) | |
| 217 | 213 | ||
| 218 | - | ||
| 219 | 214 | def test_getteachers_mock(self): | |
| 220 | 215 | jsonstr = json.load( | |
| 221 | 216 | open(self.data_path + '/getteachers_mock.json') | |
@@ -248,11 +243,6 @@ def test_gettimegrid_mock(self): | |||
| 248 | 243 | self.assertEqual(t2_raw['endTime'], t2[1].strftime('%H%M')) | |
| 249 | 244 | ||
| 250 | 245 | ||
| 251 | - | ||
| 252 | - | ||
| 253 | - | ||
| 254 | - | ||
| 255 | - | ||
| 256 | 246 | class WebUntisRemoteTests(unittest.TestCase, WebUntisTests): | |
| 257 | 247 | def setUp(self): | |
| 258 | 248 | self.session = webuntis.session.Session( | |
@@ -326,7 +316,6 @@ def test_getteachers(self): | |||
| 326 | 316 | def test_gettimeunits(self): | |
| 327 | 317 | self.session.timeunits() | |
| 328 | 318 | ||
| 329 | - | ||
| 330 | 319 | def test_gettimetables(self): | |
| 331 | 320 | print('TEST_GETTIMETABLES') | |
| 332 | 321 | timetables = [] | |
@@ -382,7 +371,6 @@ def load(test): | |||
| 382 | 371 | ||
| 383 | 372 | tests = [WebUntisOfflineTests, WebUntisRemoteTests] | |
| 384 | 373 | ||
| 385 | - | ||
| 386 | 374 | if len(sys.argv) == 1: | |
| 387 | 375 | print('ERROR: No tests specified.\n\nAdd a number to the command-line arguments to execute the test:') | |
| 388 | 376 | for i, test in enumerate(tests): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,9 +12,10 @@ | |||
| 12 | 12 | ||
| 13 | 13 | OptionStore = option_utils.OptionStore | |
| 14 | 14 | ||
| 15 | + | ||
| 15 | 16 | class lazyproperty(object): | |
| 16 | 17 | '''A read-only @property that is only evaluated once. | |
| 17 | - | ||
| 18 | + | ||
| 18 | 19 | Stolen from http://www.reddit.com/r/Python/comments/ejp25/cached_property_decorator_that_is_memory_friendly/ | |
| 19 | 20 | ''' | |
| 20 | 21 | def __init__(self, fget, doc=None): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -105,8 +105,8 @@ def __init__(self, value=None): | |||
| 105 | 105 | # A bit weird, but it formats kinda nicely in the log. | |
| 106 | 106 | # I am not logging line each, because other threads might | |
| 107 | 107 | # interfere this and fuck everything up. | |
| 108 | - logging.warning('''You specified that the API endpoint should be /. That is | ||
| 109 | - uncommon. If you didn't mean to do so, remove the slash at | ||
| 108 | + logging.warning('''You specified that the API endpoint | ||
| 109 | + should be /. That is uncommon. If you didn't mean to do so, remove the slash at | ||
| 110 | 110 | the end of your "server" parameter.''') | |
| 111 | 111 | ||
| 112 | 112 | self.value = { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments