from turbasen.events import trigger
import turbasen

def test_events():
    global mutable_list
    mutable_list = []

    def add_value_to_list():
        mutable_list.append(1)

    trigger('foo')
    turbasen.handle_event('foo', add_value_to_list)
    trigger('foo')
    trigger('bar')

    assert len(mutable_list) == 1

@@ -1,8 +1,23 @@
+import pytest%0A%0A
 from tur
@@ -70,22 +70,28 @@
 ef test_
+custom_
 event
-s
 ():%0A    
@@ -280,24 +280,24 @@
 gger('foo')%0A
-
     trigger(
@@ -338,8 +338,377 @@
 t) == 1%0A
+%0A@pytest.mark.skipif(turbasen.settings.Settings.API_KEY is None, reason=%22API key not set%22)%0Adef test_get_event():%0A    global mutable_list%0A    mutable_list = %5B%5D%0A%0A    def add_value_to_list():%0A        mutable_list.append(1)%0A%0A    turbasen.handle_event('api.get_object', add_value_to_list)%0A    turbasen.Sted.get('52407fb375049e561500004e')%0A%0A    assert len(mutable_list) == 1%0A

Add 'api.get_object' event test