@@ -0,0 +1,1062 @@
+import pytest%0Afrom time import sleep%0A%0Afrom autobahn.wamp import PublishOptions%0Afrom autobahn_sync import run, register, subscribe, publish, call, NotRunningError%0A%0Afrom fixtures import crossbar, wamp%0A%0A%0Aclass TestApi(object):%0A%0A    def setup(self):%0A        self.rpc_called = False%0A        self.sub_called = False%0A%0A    def test_api(self, crossbar):%0A        publish_opt = PublishOptions(exclude_me=False)%0A%0A        @register('api.api.rpc')%0A        def rpc():%0A            self.rpc_called = True%0A%0A        @subscribe('api.api.event')%0A        def sub():%0A            self.sub_called = True%0A%0A        with pytest.raises(NotRunningError):%0A            call('api.api.rpc')%0A%0A        with pytest.raises(NotRunningError):%0A            publish('api.api.event', options=publish_opt)%0A%0A        assert not self.rpc_called%0A        assert not self.sub_called%0A%0A        run()%0A%0A        call('api.api.rpc')%0A        publish('api.api.event', options=publish_opt)%0A        sleep(0.1)  # Dirty way to wait for on_event to be called...%0A%0A        assert self.rpc_called%0A        assert self.sub_called%0A

Add api unittests