def test_loading_of_yaml_file(self): """ Just testing loading & getting of menu items, not the content of the file. """ menu = self.loader.load_from_file(open('src/alexandria/examples/devquiz.yaml', 'r')) self.assertEquals(len(menu.stack), 4) self.assertEquals(dump_menu(menu), [ (msg('What is your favorite programming language?', [ 'java', 'c', 'python', 'ruby', 'javascript', 'php', 'other']), False), (msg('What is your favorite development operating system?', [ 'windows', 'apple', '*nix', 'other']), False), (msg('What is your favorite development environment?', [ 'netbeans', 'eclipse', 'vim', 'emacs', 'textmate', 'notepad']), False), (msg('Thanks! You have completed the quiz.', []), True) ])
def create(self, request): menu = YAMLLoader().load_from_string(request.raw_post_data) dump = dump_menu(menu) # debug logging.debug("Received a new conversation script with %s items " "but not doing anything with it yet." % len(dump)) return rc.CREATED