menu for mas editing stage and user
[redakcja.git] / lib / wlapi / tests.py
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 #
4 # This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
5 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6 #
7
8 from nose.tools import *
9 from nose.core import runmodule
10
11 import wlapi
12
13
14 class FakeDocument():
15
16     def __init__(self):
17         self.text = "Some Text"
18
19
20 class TestWLAPI(object):
21
22     def setUp(self):
23         self.api = wlapi.WLAPI(
24             URL="http://localhost:7000/api/",
25             AUTH_REALM="WL API",
26             AUTH_USER="platforma",
27             AUTH_PASSWD="platforma",
28         )
29
30     def test_basic_call(self):
31         assert_equal(self.api.list_books(), [])
32
33     def test_publish_book(self):
34         self.api.publish_book(FakeDocument())
35
36 if __name__ == '__main__':
37     runmodule()