-
-
Save rtDNVdza/7481876 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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