def test_SSHConfigDict_as_int_failures(self, non_int): conf = SSHConfigDict({"key": non_int}) try: int(non_int) except Exception as e: exception_type = type(e) with raises(exception_type): conf.as_int("key")
def test_SSHConfigDict_as_int(self, int_val): assert SSHConfigDict({"key": int_val}).as_int("key") == 42
def test_SSHConfigDict_as_bool(self, false_ish): assert SSHConfigDict({"key": false_ish}).as_bool("key") is False
def test_SSHConfigDict_as_bool_true_ish(self, true_ish): assert SSHConfigDict({"key": true_ish}).as_bool("key") is True
def test_SSHConfigDict_construct_from_dict(self): assert SSHConfigDict({1: 2})[1] == 2
def test_SSHConfigDict_construct_from_list(self): assert SSHConfigDict([(1, 2)])[1] == 2
def test_SSHConfigDict_construct_empty(self): assert not SSHConfigDict()