python自动化测试_setUp and tearDown
来源:互联网 发布:画漫画软件下载 编辑:程序博客网 时间:2024/06/05 16:50
class RomanNumeralConverter(object): def __init__(self): self.digit_map = {"M":1000, "D":500, "C":100, "L":50, "X":10, "V":5, "I":1} def convert_to_decimal(self, roman_numeral): val = 0 for char in roman_numeral: val += self.digit_map[char] return val import unittestclass RomanNumeralConverterTest(unittest.TestCase): def setUp(self): print "Create a new RomanNumeralConverterTest....." self.cvt = RomanNumeralConverter() def tearDown(self): print "Destroying a RomanNumeralConverterTest...." self.cvt = None def test_parsing_millenia(self): self.assertEquals(1000, self.cvt.convert_to_decimal("M")) if __name__ == "__main__": unittest.main()
输出结果:
Create a new RomanNumeralConverterTest.....Destroying a RomanNumeralConverterTest.....----------------------------------------------------------------------Ran 1 test in 0.000sOK
- python自动化测试_setUp and tearDown
- Python_lesson 1_setup python
- _setup()
- python自动化测试
- python自动化测试
- python + selenium 自动化测试
- python 自动化测试
- selenium + python 自动化测试
- python单元测试(自动化测试)
- 自动化测试-python脚本语言
- python自动化测试常见问题
- python自动化测试
- Python自动化测试-Selenium
- GUI测试自动化 -- python
- python自动化测试
- python unittest 自动化测试
- appium+python自动化测试
- selenium + python 自动化测试
- PHP定时执行的小代码
- 开源DBCP、C3P0、Proxool 、 BoneCP连接池的比较
- JQuery Mobile入门参考资料
- Java字符集转换解释
- 自定义Android应用程序标题条
- python自动化测试_setUp and tearDown
- linux汇编和机器码对照
- 《C++ GUI Programming with Qt4》.2 Creating Dialogs
- samsung GT 7510 host 失败
- 关于在c#里面调用win api的方法.(我看过得最详细的帖子)
- C++, Objective C, Java, C# 详细比较和区别
- Oracle 10g轻量级客户端安装记
- Devrace FIBPlus:在 Delphi 和C++ Builder 应用程序中优化网络传输
- python自动化测试_从命令行运行测试用例with verbosity