gradio/test/test_context.py
2022-03-23 09:21:30 -07:00

18 lines
396 B
Python

import unittest
from gradio.context import Context
class TestContext(unittest.TestCase):
def test_context(self):
self.assertEqual(Context.id, 0)
Context.id += 1
self.assertEqual(Context.id, 1)
Context.root_block = {}
Context.root_block["1"] = 1
self.assertEqual(Context.root_block, {"1": 1})
if __name__ == "__main__":
unittest.main()