X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/c52436a7e25876ee3509df2467c2a9ef33303436..32974185d5e2b1bdc197b4f5dcab259b5de3c6b4:/lib/test_wlapi.py diff --git a/lib/test_wlapi.py b/lib/test_wlapi.py new file mode 100644 index 00000000..a12ab068 --- /dev/null +++ b/lib/test_wlapi.py @@ -0,0 +1,37 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# + +from nose.tools import * +from nose.core import runmodule + +import wlapi + + +class FakeDocument(): + + def __init__(self): + self.text = "Some Text" + + +class TestWLAPI(object): + + def setUp(self): + self.api = wlapi.WLAPI( + URL="http://localhost:7000/api/", + AUTH_REALM="WL API", + AUTH_USER="platforma", + AUTH_PASSWD="platforma", + ) + + def test_basic_call(self): + assert_equal(self.api.list_books(), []) + + def test_publish_book(self): + self.api.publish_book(FakeDocument()) + +if __name__ == '__main__': + runmodule()