Skip to content

Commit

Permalink
Add new test for github.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rallytime committed Sep 11, 2018
1 parent f334b29 commit a3c306b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/test_github.py
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
'''
Tests for the functions in tamarack.github.py
'''

# Import Python libs
import os

# Import Tornado libs
import tornado.testing

# Import Tamarack libs
import tamarack.github

GITHUB_TEST_TOKEN = os.environ.get('GITHUB_TEST_TOKEN') or ''


class TestAPIRequest(tornado.testing.AsyncTestCase):
'''
TestCase for the api_request function
'''

@tornado.testing.gen_test
def test_basic_get_request(self):
'''
Tests that a basic API call is made to GitHub with minimal information
'''
ret = yield tamarack.github.api_request(
'https://api.github.com/repos/rallytime/tamarack/pulls/19',
GITHUB_TEST_TOKEN)
assert ret['title'] == 'Add first tests!'

0 comments on commit a3c306b

Please sign in to comment.