コード例 #1
0
 def test_validate_string_three(self):
     with pytest.raises(TargetdError) as td:
         delete_discovery(None, "\xea\x80\x80abcd\xde\xb4")
     assert str(td.value) == 'Not a ascii-encoded unicode string'
コード例 #2
0
 def test_validate_string_one(self):
     with pytest.raises(TargetdError) as td:
         delete_discovery(None, "")
     assert str(td.value) == 'Unauthorised empty string'
コード例 #3
0
 def test_validate_string_two(self):
     with pytest.raises(TargetdError) as td:
         delete_discovery(None, "1" * 256)
     assert str(td.value) == 'String too long'
コード例 #4
0
 def test_record_not_found(self):
     with pytest.raises(TargetdError) as td:
         delete_discovery(None, "essai")
     assert str(td.value) == 'Discovery record [essai,3260] not found.'
コード例 #5
0
 def test_discovery_method_error(self):
     with pytest.raises(TargetdError) as td:
         delete_discovery(None, sam_tst_host, "test")
     assert str(td.value) == ('Invalid value. Possible values'
                              ' are : sendtargets, isns')
コード例 #6
0
ファイル: test_iscsi_init.py プロジェクト: MPSTOR/Konnector
 def test_validate_string_three(self):
     with pytest.raises(TargetdError) as td:
         delete_discovery(None, "\xea\x80\x80abcd\xde\xb4")
     assert str(td.value) == 'Not a ascii-encoded unicode string'
コード例 #7
0
 def test_no_connection(self):
     with pytest.raises(TargetdError) as td:
         discover_portal(None, sam_tst_host)
     delete_discovery(None, sam_tst_host)
     assert str(td.value) == ('cannot make connection to '
                              '%s: No route to host', sam_tst_host)
コード例 #8
0
ファイル: test_iscsi_init.py プロジェクト: MPSTOR/Konnector
 def test_validate_string_two(self):
     with pytest.raises(TargetdError) as td:
         delete_discovery(None, "1"*256)
     assert str(td.value) == 'String too long'
コード例 #9
0
ファイル: test_iscsi_init.py プロジェクト: MPSTOR/Konnector
 def test_validate_string_one(self):
     with pytest.raises(TargetdError) as td:
         delete_discovery(None, "")
     assert str(td.value) == 'Unauthorised empty string'
コード例 #10
0
ファイル: test_iscsi_init.py プロジェクト: MPSTOR/Konnector
 def test_discovery_method_error(self):
     with pytest.raises(TargetdError) as td:
         delete_discovery(None,sam_tst_host, "test")
     assert str(td.value) == ('Invalid value. Possible values'
                              ' are : sendtargets, isns')
コード例 #11
0
ファイル: test_iscsi_init.py プロジェクト: MPSTOR/Konnector
 def test_record_not_found(self):
     with pytest.raises(TargetdError) as td:
         delete_discovery(None, "essai")
     assert str(td.value) == 'Discovery record [essai,3260] not found.'
コード例 #12
0
ファイル: test_iscsi_init.py プロジェクト: MPSTOR/Konnector
 def test_no_connection(self):
     with pytest.raises(TargetdError) as td:
         discover_portal(None, sam_tst_host)
     delete_discovery(None, sam_tst_host)
     assert str(td.value) == ('cannot make connection to '
                              '%s: No route to host', sam_tst_host)