forked from douban/code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_github.py
More file actions
24 lines (17 loc) · 754 Bytes
/
test_github.py
File metadata and controls
24 lines (17 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- coding: utf-8 -*-
from tests.base import TestCase
from vilya.models.user import CodeDoubanUserGithub
class TestGithub(TestCase):
def test_simple_github(self):
github = CodeDoubanUserGithub(-1, 'testu', 'testug')
assert github.user_name == 'testug'
assert github.user_id == 'testu'
def test_add_github(self):
github = CodeDoubanUserGithub.add('testu', 'testug')
assert github.user_name == 'testug'
assert github.user_id == 'testu'
def test_get_by_user_name(self):
g1 = CodeDoubanUserGithub.add('testu1', 'testug1')
g2 = CodeDoubanUserGithub.add('testu2', 'testug2')
g3 = CodeDoubanUserGithub.get_by_user_name('testug2')
assert g3.user_id == 'testu2'