Skip to content

Instantly share code, notes, and snippets.

@rtDNVdza
Created November 15, 2013 09:54
Show Gist options
  • Save rtDNVdza/7481876 to your computer and use it in GitHub Desktop.
Save rtDNVdza/7481876 to your computer and use it in GitHub Desktop.
#coding:UTF-8
from nose.tools import *
import nose
import sys
sys.path.append("../ex47") # 把 这个文件的上级目录的 ex47 加下 python 的模组 索引路径目录
from ex47.game import Room # 把 ex47这个文件夹下的 game.py 里的 Room 类导入进来
def test_room():
gold = Room("GoldRoom",
"""This room has gold in it you can grab. There's a
door to the north.""") # 创建一个 Room 类的对象 gold , 参数1表示name 2表示description
assert_equal(gold.name, "GoldRoom")
assert_equal(gold.paths, {}) # {} 表示空字典
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment