From 52c08abb82ec04ba60818a7401ea84348e8c7ef3 Mon Sep 17 00:00:00 2001 From: ryo_saeba Date: Sat, 25 Sep 2010 08:00:27 +0000 Subject: [PATCH] Misc tests. git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13881 282e977c-c81d-0410-88c4-b93c2d0d6712 --- test/find_by_arch_name | 107 ++++++++++++++++++++++++++++++++++++++ test/find_by_arch_name.py | 14 +++++ 2 files changed, 121 insertions(+) create mode 100644 test/find_by_arch_name create mode 100644 test/find_by_arch_name.py diff --git a/test/find_by_arch_name b/test/find_by_arch_name new file mode 100644 index 000000000..31252f2ec --- /dev/null +++ b/test/find_by_arch_name @@ -0,0 +1,107 @@ +arch map +name find_by_arch_name +width 5 +height 5 +msg +Created: 2010-02-28 Nicolas Weeger +Modified: 2010-02-28 Nicolas Weeger +endmsg +end +arch afloor_left +end +arch afloor_left +y 1 +end +arch afloor_left +y 2 +end +arch afloor_left +y 3 +end +arch afloor_left +y 4 +end +arch afloor_left +x 1 +end +arch afloor_left +x 1 +y 1 +end +arch afloor_left +x 1 +y 2 +end +arch afloor_left +x 1 +y 3 +end +arch afloor_left +x 1 +y 4 +end +arch afloor_left +x 2 +end +arch afloor_left +x 2 +y 1 +end +arch afloor_left +x 2 +y 2 +end +arch pirate_lass +x 2 +y 2 +arch event_say +title Python +slaying /test/find_by_arch_name.py +end +end +arch afloor_left +x 2 +y 3 +end +arch afloor_left +x 2 +y 4 +end +arch afloor_left +x 3 +end +arch afloor_left +x 3 +y 1 +end +arch afloor_left +x 3 +y 2 +end +arch afloor_left +x 3 +y 3 +end +arch afloor_left +x 3 +y 4 +end +arch afloor_left +x 4 +end +arch afloor_left +x 4 +y 1 +end +arch afloor_left +x 4 +y 2 +end +arch afloor_left +x 4 +y 3 +end +arch afloor_left +x 4 +y 4 +end diff --git a/test/find_by_arch_name.py b/test/find_by_arch_name.py new file mode 100644 index 000000000..23e1aa4b3 --- /dev/null +++ b/test/find_by_arch_name.py @@ -0,0 +1,14 @@ +import Crossfire + +who = Crossfire.WhoAmI() +pl = Crossfire.WhoIsActivator() +msg = Crossfire.WhatIsMessage() + +found = pl.CheckArchInventory(msg) + +who.Say('check for find_arch_by_name') + +if (found != None): + who.Say('found %s'%found.Name) +else: + who.Say('didn\'t find %s'%msg)