Ejemplo n.º 1
0
 def test_validate_string_three(self):
     with pytest.raises(TargetdError) as td:
         login_target(None, "\xea\x80\x80abcd\xde\xb4")
     assert str(td.value) == 'Not a ascii-encoded unicode string'
Ejemplo n.º 2
0
 def test_validate_string_one(self):
     with pytest.raises(TargetdError) as td:
         login_target(None, "")
     assert str(td.value) == 'Unauthorised empty string'
Ejemplo n.º 3
0
 def test_validate_string_two(self):
     with pytest.raises(TargetdError) as td:
         login_target(None, "1" * 256)
     assert str(td.value) == 'String too long'
Ejemplo n.º 4
0
 def test_no_records_found(self):
     with pytest.raises(TargetdError) as td:
         login_target(None, "iqn")
     assert 'no records found' in str(td.value).lower()
Ejemplo n.º 5
0
 def test_auth_method_error(self):
     with pytest.raises(TargetdError) as td:
         login_target(None, "iqn", None, "test")
     assert str(td.value) == ('Invalid value. Possible values are'
                              ' : chap, mutual_chap')
Ejemplo n.º 6
0
 def test_validate_string_three(self):
     with pytest.raises(TargetdError) as td:
         login_target(None, "\xea\x80\x80abcd\xde\xb4")
     assert str(td.value) == 'Not a ascii-encoded unicode string'
Ejemplo n.º 7
0
 def test_validate_string_two(self):
     with pytest.raises(TargetdError) as td:
         login_target(None, "1"*256)
     assert str(td.value) == 'String too long'
Ejemplo n.º 8
0
 def test_validate_string_one(self):
     with pytest.raises(TargetdError) as td:
         login_target(None, "")
     assert str(td.value) == 'Unauthorised empty string'
Ejemplo n.º 9
0
 def test_auth_method_error(self):
     with pytest.raises(TargetdError) as td:
         login_target(None, "iqn", None, "test")
     assert str(td.value) == ('Invalid value. Possible values are'
                              ' : chap, mutual_chap')
Ejemplo n.º 10
0
 def test_no_records_found(self):
     with pytest.raises(TargetdError) as td:
         login_target(None, "iqn")
     assert 'no records found' in str(td.value).lower()