コード例 #1
0
ファイル: test_excellib.py プロジェクト: dgorissen/pycel
    def test_invalid_parameters(self):
        assert mid(VALUE_ERROR, 2, 2) == VALUE_ERROR
        assert mid('Romain', VALUE_ERROR, 2) == VALUE_ERROR
        assert mid('Romain', 2, VALUE_ERROR) == VALUE_ERROR
        assert mid(DIV0, 2, 2) == DIV0
        assert mid('Romain', DIV0, 2) == DIV0
        assert mid('Romain', 2, DIV0) == DIV0

        assert mid('Romain', 'x', 2) == VALUE_ERROR
        assert mid('Romain', 2, 'x') == VALUE_ERROR
コード例 #2
0
    def test_invalid_parameters(self):
        assert mid(VALUE_ERROR, 2, 2) == VALUE_ERROR
        assert mid('Romain', VALUE_ERROR, 2) == VALUE_ERROR
        assert mid('Romain', 2, VALUE_ERROR) == VALUE_ERROR
        assert mid(DIV0, 2, 2) == DIV0
        assert mid('Romain', DIV0, 2) == DIV0
        assert mid('Romain', 2, DIV0) == DIV0

        assert mid('Romain', 'x', 2) == VALUE_ERROR
        assert mid('Romain', 2, 'x') == VALUE_ERROR
コード例 #3
0
ファイル: excellib.py プロジェクト: omalleyt12/pycel-1
 def test_mid(self):
     self.assertEqual(mid('Romain', 2, 9), 'main')
コード例 #4
0
ファイル: excellib.py プロジェクト: omalleyt12/pycel-1
 def test_num_chars_must_be_positive(self):
     with self.assertRaises(ValueError):
         mid('Romain', 1, -1)
コード例 #5
0
ファイル: excellib.py プロジェクト: omalleyt12/pycel-1
 def test_start_num_must_be_superior_or_equal_to_1(self):
     with self.assertRaises(ValueError):
         mid('Romain', 0, 3)
コード例 #6
0
ファイル: excellib.py プロジェクト: omalleyt12/pycel-1
 def test_num_chars_must_be_integer(self):
     with self.assertRaises(TypeError):
         mid('Romain', 1, 2.1)
コード例 #7
0
ファイル: excellib.py プロジェクト: SergeBredin/pycel
 def test_num_chars_must_be_integer(self):
     with self.assertRaises(TypeError):
         mid('Romain', 1, 2.1)
コード例 #8
0
 def test_from_not_str(self):
     assert '23' == mid(1234, 2, 2)
コード例 #9
0
 def test_start_num_must_be_superior_or_equal_to_1(self):
     assert VALUE_ERROR == mid('Romain', 0, 3)
コード例 #10
0
ファイル: test_excellib.py プロジェクト: dgorissen/pycel
 def test_num_chars_must_be_positive(self):
     assert VALUE_ERROR == mid('Romain', 1, -1)
コード例 #11
0
ファイル: test_excellib.py プロジェクト: dgorissen/pycel
 def test_start_num_must_be_superior_or_equal_to_1(self):
     assert VALUE_ERROR == mid('Romain', 0, 3)
コード例 #12
0
ファイル: test_excellib.py プロジェクト: dgorissen/pycel
 def test_num_chars_must_be_integer(self):
     assert 'Ro' == mid('Romain', 1, 2.1)
コード例 #13
0
ファイル: excellib.py プロジェクト: SergeBredin/pycel
 def test_mid(self):
     self.assertEqual(mid('Romain', 2, 9), 'main')
コード例 #14
0
ファイル: excellib.py プロジェクト: SergeBredin/pycel
 def test_num_chars_must_be_positive(self):
     with self.assertRaises(ValueError):
         mid('Romain', 1, -1)
コード例 #15
0
ファイル: excellib.py プロジェクト: SergeBredin/pycel
 def test_start_num_must_be_superior_or_equal_to_1(self):
     with self.assertRaises(ValueError):
         mid('Romain', 0, 3)
コード例 #16
0
ファイル: test_excellib.py プロジェクト: dgorissen/pycel
 def test_from_not_str(self):
     assert '23' == mid(1234, 2, 2)
コード例 #17
0
 def test_num_chars_must_be_integer(self):
     assert 'Ro' == mid('Romain', 1, 2.1)
コード例 #18
0
ファイル: test_excellib.py プロジェクト: dgorissen/pycel
 def test_mid(self):
     assert 'omain' == mid('Romain', 2, 9)
     assert 'om' == mid('Romain', 2.1, 2)
     assert 'om' == mid('Romain', 2, 2.1)
コード例 #19
0
 def test_num_chars_must_be_positive(self):
     assert VALUE_ERROR == mid('Romain', 1, -1)
コード例 #20
0
ファイル: excellib.py プロジェクト: omalleyt12/pycel-1
 def test_start_num_must_be_integer(self):
     with self.assertRaises(TypeError):
         mid('Romain', 1.1, 2)
コード例 #21
0
 def test_mid(self):
     assert 'omain' == mid('Romain', 2, 9)
     assert 'om' == mid('Romain', 2.1, 2)
     assert 'om' == mid('Romain', 2, 2.1)
コード例 #22
0
ファイル: excellib.py プロジェクト: SergeBredin/pycel
 def test_start_num_must_be_integer(self):
     with self.assertRaises(TypeError):
         mid('Romain', 1.1, 2)