Skip to content

Commit

Permalink
Merge pull request #10 from SongyanHou/built-intests
Browse files Browse the repository at this point in the history
Built intests
  • Loading branch information
enzeli committed Apr 26, 2015
2 parents 01edbaf + 688d489 commit 3d036ce
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions built_in_tests.py
@@ -0,0 +1,23 @@
import unittest
import instat_built_in as instat


class TestBuiltIn(unittest.TestCase):
def test_show(self):
self.assertNotEqual(instat.show('helloworld'), None, 'show does not create a url')

def test_search(self):
self.assertNotEqual(instat.search('helloworld'), None, 'search does not generate media')

def test_barchart(self):
instat.barchart([1, 2, 3], [1, 2, 3])

def test_piechart(self):
instat.piechart([40, 10, 20, 30], ['Project', 'Homework', 'Midterm', 'Final'], 'PLT Grades')

def test_linechart(self):
instat.linechart([1, 2, 3], [1, 2, 3])

if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(TestBuiltIn)
unittest.TextTestRunner(verbosity=2).run(suite)
1 change: 1 addition & 0 deletions instat_built_in.py
Expand Up @@ -12,6 +12,7 @@ def show(tag_name):
media.append(tag_media.get_standard_resolution_url())
show_image(media[0], title='#'+tag_name)
print media[0]
return media[0]

def search(user=None, location=None, tag_name=None, start_time=None, end_time=None):
api = InstagramAPI(client_id='fae19a5f499c4aff820f71ce869e5579', client_secret='c3a8e0773e174a8caa2f785e9120d5b5')
Expand Down

0 comments on commit 3d036ce

Please sign in to comment.