Passed
Push — master ( 795fc4...bbae7c )
by dai
11:39 queued 09:30
created

test_bm_teacher.TestBmTeacher.test_place_schedule()   A

Complexity

Conditions 2

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nop 1
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
4
import sys
5
import os
6
7
cur_path = os.path.abspath(__file__)
8
parent = os.path.dirname
9
sys.path.append(parent(parent(cur_path)))
10
11
from school_api import SchoolClient
12
import unittest
13
14
15
class TestBmTeacher(unittest.TestCase):
16
    BM_TEACHER_ACCOUNT = os.getenv('GDST_BM_TEACHER_ACCOUNT', '')
17
    BM_TEACHER_PASSWD = os.getenv('GDST_BM_TEACHER_PASSWD', '')
18
    GdstApi = SchoolClient('http://61.142.33.204')
19
    bm_teacher = GdstApi.user_login(BM_TEACHER_ACCOUNT, BM_TEACHER_PASSWD,  user_type=2, timeout=3)
20
21
    def setUp(self):
22
        print('正在执行\033[1;35m %s \033[0m函数。' % self._testMethodName)
23
24
    def tearDown(self):
25
        pass
26
27
    def test_schedule(self):
28
        schedule_data = self.bm_teacher.get_schedule(class_name='15软件本科2班', timeout=5)
29
        print(schedule_data)
30
31
    def test_place_schedule(self):
32
        for schedule_data in self.bm_teacher.get_place_schedule(campus_list=[u"本部"], timeout=0.5):
33
            print(schedule_data)
34
            break
35
36
37
if __name__ == '__main__':
38
    unittest.main()
39