Esempio n. 1
0
 def test_validate_string_three(self):
     with pytest.raises(TargetdError) as td:
         discover_portal(None, "\xea\x80\x80abcd\xde\xb4")
     assert str(td.value) == 'Not a ascii-encoded unicode string'
Esempio n. 2
0
 def test_validate_string_one(self):
     with pytest.raises(TargetdError) as td:
         discover_portal(None, "")
     assert str(td.value) == 'Unauthorised empty string'
Esempio n. 3
0
 def test_validate_string_two(self):
     with pytest.raises(TargetdError) as td:
         discover_portal(None, "1" * 256)
     assert str(td.value) == 'String too long'
Esempio n. 4
0
 def test_discovery_method_error(self):
     with pytest.raises(TargetdError) as td:
         discover_portal(None, sam_tst_host, "test")
     assert str(td.value) == ('Invalid value. Possible values'
                              ' are : sendtargets, isns')
Esempio n. 5
0
 def test_auth_method_error(self):
     with pytest.raises(TargetdError) as td:
         discover_portal(None, sam_tst_host, "sendtargets", "test")
     assert str(td.value) == ('Invalid value. Possible values are'
                              ' : chap, mutual_chap')
Esempio n. 6
0
 def test_validate_string_three(self):
     with pytest.raises(TargetdError) as td:
         discover_portal(None, "\xea\x80\x80abcd\xde\xb4")
     assert str(td.value) == 'Not a ascii-encoded unicode string'
Esempio n. 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)
Esempio n. 8
0
 def test_validate_string_two(self):
     with pytest.raises(TargetdError) as td:
         discover_portal(None, "1"*256)
     assert str(td.value) == 'String too long'
Esempio n. 9
0
 def test_validate_string_one(self):
     with pytest.raises(TargetdError) as td:
         discover_portal(None, "")
     assert str(td.value) == 'Unauthorised empty string'
Esempio n. 10
0
 def test_auth_method_error(self):
     with pytest.raises(TargetdError) as td:
         discover_portal(None, sam_tst_host, "sendtargets", "test")
     assert str(td.value) == ('Invalid value. Possible values are'
                              ' : chap, mutual_chap')
Esempio n. 11
0
 def test_discovery_method_error(self):
     with pytest.raises(TargetdError) as td:
         discover_portal(None, sam_tst_host, "test")
     assert str(td.value) == ('Invalid value. Possible values'
                              ' are : sendtargets, isns')
Esempio n. 12
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)