Skip to content

Commit

Permalink
g complex test
Browse files Browse the repository at this point in the history
  • Loading branch information
divi255 committed Jul 20, 2019
1 parent 7a9a535 commit 64c9baf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from types import SimpleNamespace

result = SimpleNamespace(
g=None,
function_collection=0,
task_collection=0,
background_task_annotated=None,
Expand All @@ -36,10 +37,21 @@ def wait():
class Test(unittest.TestCase):

def test_g(self):

@background_task
def f():
result.g = g.get('test', 222)
g.set('ttt', 333)

g.set('test', 1)
g.clear('test')
g.set('test_is', g.has('test'))
self.assertFalse(g.get('test_is'))
g.set('test', 999)
f()
wait()
self.assertIsNone(g.get('ttt'))
self.assertEqual(result.g, 222)

def test_function_collection(self):

Expand Down

0 comments on commit 64c9baf

Please sign in to comment.