Skip to content

Commit

Permalink
Merge pull request #28 from rallytime/github-file-tests
Browse files Browse the repository at this point in the history
Add new test for github.py
  • Loading branch information
Nicole Thomas committed Sep 11, 2018
2 parents f334b29 + a3c306b commit 172c827
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 172c827

Please sign in to comment.