Got a demo coming? Write automated tests that simulate the steps you'll be taking. Then print out your test suite, and use it like a script.
With these steps, we will see how to write our management demo script in a runnable fashion.
Create a new file called
recipe66.py
to store the test code for our management demo.Create a
unittest
test scenario to capture your demo.Write a series of operations as if you were driving the application from this automated test.
Include asserts at every point where you will vocally point out something during the demo.
import unittest from network import * from springpython.database.factory import * class ManagementDemo(unittest.TestCase): def setUp(self): factory = MySQLConnectionFactory("user", "password", "localhost", "recipe62") self.correlator = EventCorrelator(factory) dt = DatabaseTemplate(factory) sql = open("recipe62_network.mysql"...