Skip to content
This repository was archived by the owner on Oct 23, 2020. It is now read-only.

Commit 4ad512e

Browse files
committed
add simple test
1 parent d352895 commit 4ad512e

6 files changed

Lines changed: 100 additions & 1 deletion

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ python:
55

66
install: python setup.py install
77

8-
script: catsup --help
8+
script: nosetests

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,7 @@
4040
'Programming Language :: Python :: 3.2',
4141
'Programming Language :: Python :: 3.3',
4242
],
43+
tests_require=['nose'],
44+
test_suite='nose.collector',
4345
**kwargs
4446
)

test/blog/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deploy/

test/blog/config.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"site": {
3+
"name": "blogname",
4+
"url": "http://blog.com"
5+
},
6+
7+
"author": {
8+
"name": "name",
9+
"twitter": "twitter"
10+
},
11+
12+
"config": {
13+
"source": "posts",
14+
"output": "deploy",
15+
"static": "deploy/static",
16+
"static_prefix": "/static/",
17+
"feed": "/feed.xml",
18+
"per_page": 3,
19+
"posts_on_feed": 5,
20+
"analytics": "",
21+
"display_summary": false,
22+
"escape_md": false
23+
},
24+
25+
"comment": {
26+
"allow": true,
27+
"system": "disqus",
28+
"disqus": "catsup",
29+
"duoshuo": "catsup"
30+
},
31+
32+
"deploy": {
33+
"default": "rsync",
34+
35+
"git": {
36+
"repo": "repo url here",
37+
"branch": "master",
38+
"delete": true
39+
},
40+
41+
"rsync": {
42+
"ssh_port": 22,
43+
"ssh_user": "username",
44+
"ssh_host": "123.45.6.78",
45+
"document_root": "~/website.com/",
46+
"delete": true
47+
}
48+
},
49+
50+
"theme": {
51+
"name": "sealscript",
52+
"vars": {
53+
"description": "a blog",
54+
"github": "whtsky",
55+
"links": [
56+
{
57+
"name": "catsup",
58+
"url": "https://github.com/whtsky/catsup",
59+
"description": "Awesome!"
60+
}
61+
]
62+
}
63+
}
64+
}

test/blog/posts/2013-01-21-test.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Test
2+
3+
- tags: catsup, python
4+
- comment: disabled
5+
- summary: this is a test post
6+
7+
---
8+
9+
this is a test post
10+
11+
```python
12+
print "Hello World!"
13+
```

test/test.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import os
2+
3+
CWD = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'blog')
4+
5+
import catsup.utils
6+
7+
8+
def call(cmd):
9+
assert catsup.utils.call(cmd, silence=True, cwd=CWD) == 0
10+
11+
12+
def test():
13+
call('catsup build')
14+
call('catsup themes')
15+
call('catsup install git://github.com/whtsky/catsup-theme-sealscript.git')
16+
call('catsup install sealscript')
17+
call('catsup -h')
18+
call('catsup --version')
19+
call('rm -rf themes')

0 commit comments

Comments
 (0)