-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_fizzbuzz_api.py
26 lines (23 loc) · 931 Bytes
/
test_fizzbuzz_api.py
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
26
import unittest
from app import app
class TestRounting(unittest.TestCase):
def test_fail(self):
self.app = app.test_client()
response = self.app.get('/')
self.assertEqual(response.status_code , 200)
self.assertEqual('Hello Flask' , response.data)
def test_3_fizz(self):
self.app = app.test_client()
response = self.app.get('/fizzbuzz/3')
self.assertEqual(response.status_code , 200)
self.assertEqual('Fizz' , response.data)
def test_5_fizz(self):
self.app = app.test_client()
response = self.app.get('/fizzbuzz/5')
self.assertEqual(response.status_code , 200)
self.assertEqual('Buzz' , response.data)
def test_15_fizz(self):
self.app = app.test_client()
response = self.app.get('/fizzbuzz/15')
self.assertEqual(response.status_code , 200)
self.assertEqual('FizzBuzz' , response.data)