Explorar o código

Created quand.html for showing off (Not done yet)

Marco Quezada %!s(int64=10) %!d(string=hai) anos
pai
achega
a105e911e2

+ 3 - 3
hackathon_starter/hackathon/scripts/census.py

@@ -14,7 +14,7 @@ API_BASE_URL = 'http://api.census.gov/data/2013/pep/natstprc'
 
 def getPopulationEstimate(url):
 	req = requests.get(url)
-	print len(req.text)
-	# print req.text
+	#print len(req.text)
+	print req.text
 
-getPopulationEstimate('http://api.census.gov/data/2013/pep/monthlynatchar5?get=AGE,SEX,DATE,RACE5,HISP,POP,UNIVERSE&key=1286203d2772de1f09f13392cc42a0197b2cd414')
+getPopulationEstimate('http://api.census.gov/data/2013/pep/monthlynatchar5?get=AGE,SEX,DATE,RACE5,HISP&key=1286203d2772de1f09f13392cc42a0197b2cd414')

+ 37 - 0
hackathon_starter/hackathon/templates/hackathon/quandl.html

@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<body>
+	{% include 'hackathon/base.html' %}
+
+    <h1 class="text-center"> Quandl Collection </h1>
+    <h2 class="text-center"> Dow Jones Data </h2>
+	<div class="col-lg-12">
+        <div class="table-responsive">
+            <table class="table table-bordered table-hover table-striped tablesorter">
+                <thead>
+                <tr>
+                <th class="header"> Name <i class="icon-sort"></i></th>
+                <th class="header"> Description <i class="icon-sort"></i></th>
+                <th class="header"> Data <i class="icon-sort"></i></th>
+                <th class="header"> Code <i class="icon-sort"></i></th>
+                
+                </tr>
+            </thead>
+            <tbody>
+
+            {% for data in data.dowjones %}
+                <tr>
+                    <td>{{ data.name }}</td>
+                    <td>{{ data.description }}</td>
+                    <td>{{ data.data }}</td>
+                    <td>{{ data.code }}</td>
+    	        </tr>
+            {% endfor %}
+
+            </tbody>
+            </table>
+        </div>
+    </div>
+        
+</body>
+</html>

+ 41 - 0
hackathon_starter/hackathon/tests.py

@@ -1,3 +1,44 @@
 from django.test import TestCase
 
 # Create your tests here.
+
+class HackathonViewsTestCase(TestCase):
+	def testIndex(self):
+		resp = self.client.get('/hackathon/api/')
+		self.assertEqual(resp.status_code, 200)
+
+	def testSteam(self):
+		resp = self.client.get('/hackathon/steam')
+		self.assertEqual(resp.status_code, 301)
+
+	def testSteamDiscountedGames(self):
+		resp = self.client.get('/hackathon/steamDiscountedGames/')
+		self.assertEqual(resp.status_code, 200)
+
+	def testQuandlDowJones(self):
+		resp = self.client.get('/hackathon/quandlDowJones/')
+		self.assertEqual(resp.status_code, 200)
+
+	def testQuandlSnp500(self):
+		resp = self.client.get('/hackathon/quandlSnp500/')
+		self.assertEqual(resp.status_code, 200)
+
+	def testQuandlNasdaq(self):
+		resp = self.client.get('/hackathon/quandlNasdaq/')
+		self.assertEqual(resp.status_code, 200)
+
+	def testGithubUser(self):
+		resp = self.client.get('/hackathon/githubUser/')
+		self.assertEqual(resp.status_code, 200)
+
+	def testGithubTopRepositories(self):
+		resp = self.client.get('/hackathon/githubTopRepositories/')
+		self.assertEqual(resp.status_code, 200)
+
+	def testGithubResume(self):
+		resp = self.client.get('/hackathon/githubResume/')
+		self.assertEqual(resp.status_code, 200)
+
+	def testTwilio(self):
+		resp = self.client.get('/hackathon/twilio/')
+		self.assertEqual(resp.status_code, 200)

+ 1 - 1
hackathon_starter/hackathon/unittests/testgithub.py

@@ -29,7 +29,7 @@ class GithubTests(unittest.TestCase):
 
 		with patch('hackathon.scripts.github.getUserData') as mock_getUserData:
 			# Mock the return value of this method
-			mock_getUserData.return_value = {'public_repos': 51, 'public_gists': 5, 'name': 'David Leonard', 'blog': 'http://drksephy.github.io', 'avatar_url': 'https://avatars.githubusercontent.com/u/1226900?v=3', 'followers': 50, 'following': 7, 'email': 'DrkSephy1025@gmail.com'}
+			mock_getUserData.return_value = {'public_repos': 52, 'public_gists': 5, 'name': 'David Leonard', 'blog': 'http://drksephy.github.io', 'avatar_url': 'https://avatars.githubusercontent.com/u/1226900?v=3', 'followers': 51, 'following': 7, 'email': 'DrkSephy1025@gmail.com'}
 			jsonList.append(mock_getUserData.return_value)
 			for data in jsonList:
 				userData['name'] = mock_getUserData.return_value['name']