MCPcopy Create free account
hub / github.com/NCAR/wrf-python / TestThread

Class TestThread

test/cachetest.py:18–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16
17
18class TestThread(Thread):
19 def __init__(self, num, q):
20 self.num = num
21 self.q = q
22 super(TestThread, self).__init__()
23
24 def run(self):
25 for i in range(get_cache_size() + 10):
26 key = "A" + str(i)
27 cache_item(key, "test", i * self.num)
28
29 item = get_cached_item(key, "test")
30
31 if item != i * self.num:
32 raise RuntimeError("cache is bogus")
33
34 cache = OrderedDict(_get_cache())
35
36 self.q.put(cache)
37
38
39class CacheTest(ut.TestCase):

Callers 1

test_thread_localMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_thread_localMethod · 0.68