示例#1
0
 def compare(self):
     closed_section = ClosedSection(3,7)
     return closed_section
示例#2
0
 def test_入力3と7は入力3と7に含まれる(self,compare):
     closed_section = ClosedSection(3,7)
     assert compare.includes(closed_section) == True, "入力3と7は入力3と7に含まれる"
示例#3
0
 def test_入力3と5は入力3と5と等価である(self,compare):
     closed_section = ClosedSection(3,5)
     assert compare.equals(closed_section), "[3,5]と[3,5]が等価でないことになっています。"
示例#4
0
 def test_入力3と5は入力1と7と等価ではない(self,compare):
     closed_section = ClosedSection(1,7)
     assert compare.equals(closed_section) == False, "[3,5]と[1,7]が等価になっています。"  
示例#5
0
 def test_2つの整数3と5を入力とするインスタンスを生成するクラスの作成ができることの確認(self):
     closed_section = ClosedSection(3,5)
     assert isinstance(closed_section, ClosedSection), "正しいインスタンスが生成されていません。"
示例#6
0
 def initialize(self):
     closed_section = ClosedSection(3,7)
     return closed_section
示例#7
0
 def test_上端点より下端点が大きい入力5と3の場合はInputValueErrorを出力(self):
     with pytest.raises(InputValueError):
         closed_section = ClosedSection(5,3)
示例#8
0
 def test_2つの小数1_2と1_7を入力をするとInputTypeErrorを出力(self):
     with pytest.raises(InputTypeError):
         closed_section = ClosedSection(1.2,1.7)
示例#9
0
 def test_入力8と9は入力3と7に含まれない(self,compare):
     closed_section = ClosedSection(8,9)
     assert compare.includes(closed_section) == False, "入力8と9は入力3と7に含まれない"