def run_test(self, test_inputs, test_outputs): if not self._test_setup(): return if isinstance(test_inputs, basestring): test_inputs = [test_inputs] * len(test_outputs) for ins, outs in zip(test_inputs, test_outputs): self.m.advance_state(string_to_bools(ins)) if not self._check_state(self.m.get_output(), outs): self.failed_test = self.num_tests return
def do_advance(self, args): if len(args) != 6: print "You must provide 6 input bits." return self.m.advance_state(tools.string_to_bools(args)) self.do_cur_state(None)