-
Notifications
You must be signed in to change notification settings - Fork 4
/
app-tests.py
62 lines (46 loc) · 1.43 KB
/
app-tests.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import os
import unittest
import app
# such unit testing
class DaasTestCase(unittest.TestCase):
# much code coverage
def setUp(self):
self.app = app.app.test_client()
# Individual api function tests
def test_index(self):
rv = self.app.get('/')
assert 'Doge as a Service' in rv.data
def test_wow(self):
rv = self.app.get('/wow/foobar')
assert 'wow such foobar' in rv.data
def test_very(self):
rv = self.app.get('/very/foobar')
assert 'very foobar. wow' in rv.data
def test_plz(self):
rv = self.app.get('/plz/foo/bar')
assert 'foo plz' and 'from bar' in rv.data
def test_anon_plz(self):
rv = self.app.get('/plz/foo')
assert 'foo plz' in rv.data
def test_little(self):
rv = self.app.get('/little/foo')
assert 'little foo. wow' in rv.data
def test_wat(self):
rv = self.app.get('/wat/foo')
assert 'wat r u doin, foo' in rv.data
def test_omg(self):
rv = self.app.get('/omg/foo')
assert 'omg such foo. wow' in rv.data
def test_thx(self):
rv = self.app.get('/thx/foo/bar')
assert 'thx foo' and 'from bar' in rv.data
def test_anon_thx(self):
rv = self.app.get('/thx/foo')
assert 'thx foo' in rv.data
def test_fuk(self):
rv = self.app.get('/fuk/foo/bar')
assert 'fuk u foo' and 'from bar' in rv.data
def test_anon_fuk(self):
rv = self.app.get('/fuk/foo')
assert 'fuk u foo' in rv.data
if __name__ == '__main__': unittest.main()