forked from pyapi-gitlab/pyapi-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase_test.py
More file actions
25 lines (19 loc) · 762 Bytes
/
base_test.py
File metadata and controls
25 lines (19 loc) · 762 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
25
import os
import unittest
import responses
from gitlab import Gitlab
class BaseTest(unittest.TestCase):
@responses.activate
def setUp(self):
self.user = os.environ.get('gitlab_user', 'root')
self.password = os.environ.get('gitlab_password', '5iveL!fe')
self.host = os.environ.get('gitlab_host', 'http://localhost:10080')
self.gitlab = Gitlab(host=self.host, verify_ssl=False, suppress_http_error=False)
self.gitlab.host = self.host
responses.add(
responses.POST,
self.gitlab.api_url + '/session',
json={'private_token': 'test'},
status=201,
content_type='application/json')
self.gitlab.login(user=self.user, password=self.password)