'Validate that the given input lines produce the resulting namespace.
Note: the input lines are given exactly as they would be typed in an
auto-indenting environment, as mini_interactive_loop above already does
auto-indenting and prepends spaces to the input.'

def check_ns(self, lines, ns):

    src = mini_interactive_loop(pseudo_input(lines))
    test_ns = {}
    exec src in test_ns
    for (k, v) in ns.items():
        self.assertEqual(test_ns[k], v)
