コード例 #1
0
ファイル: test_inputs.py プロジェクト: rheehot/sanic-restplus
 def test_checkbox(self):
     assert inputs.boolean('on') is True
コード例 #2
0
ファイル: test_inputs.py プロジェクト: rheehot/sanic-restplus
 def test_non_strings(self):
     assert inputs.boolean(0) is False
     assert inputs.boolean(1) is True
     assert inputs.boolean([]) is False
コード例 #3
0
ファイル: test_inputs.py プロジェクト: rheehot/sanic-restplus
 def test_python_bool(self):
     assert inputs.boolean(True) is True
     assert inputs.boolean(False) is False
コード例 #4
0
ファイル: test_inputs.py プロジェクト: rheehot/sanic-restplus
 def test_bad_boolean(self):
     with pytest.raises(ValueError):
         inputs.boolean('blah')
     with pytest.raises(ValueError):
         inputs.boolean(None)
コード例 #5
0
ファイル: test_inputs.py プロジェクト: rheehot/sanic-restplus
 def test_case(self):
     assert inputs.boolean('FaLSE') is False
     assert inputs.boolean('FaLSE') is False
コード例 #6
0
ファイル: test_inputs.py プロジェクト: rheehot/sanic-restplus
 def test_1(self):
     assert inputs.boolean('1') is True
コード例 #7
0
ファイル: test_inputs.py プロジェクト: rheehot/sanic-restplus
 def test_true(self):
     assert inputs.boolean('true') is True
コード例 #8
0
ファイル: test_inputs.py プロジェクト: rheehot/sanic-restplus
 def test_0(self):
     assert inputs.boolean('0') is False
コード例 #9
0
ファイル: test_inputs.py プロジェクト: rheehot/sanic-restplus
 def test_false(self):
     assert inputs.boolean('False') is False