| 591 | |
| 592 | class TestServerCaching(unittest.TestCase): |
| 593 | def runTest(self): |
| 594 | return # FIXME broken |
| 595 | tmpfile = NamedTemporaryFile() |
| 596 | path = tmpfile.name |
| 597 | tmpfile.close() |
| 598 | |
| 599 | # create cache file |
| 600 | server = Server(shelffile=path) |
| 601 | |
| 602 | # modify cache content |
| 603 | id = ua.NodeId(ua.ObjectIds.Server_ServerStatus_SecondsTillShutdown) |
| 604 | s = shelve.open(path, "w", writeback=True) |
| 605 | s[id.to_string()].attributes[ua.AttributeIds.Value].value = ua.DataValue(123) |
| 606 | s.close() |
| 607 | |
| 608 | # ensure that we are actually loading from the cache |
| 609 | server = Server(shelffile=path) |
| 610 | self.assertEqual(server.get_node(id).get_value(), 123) |
| 611 | |
| 612 | os.remove(path) |
| 613 | |
| 614 | |
| 615 | class TestServerStartError(unittest.TestCase): |