예제 #1
0
    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")
예제 #2
0
 def test_SSHConfigDict_as_int(self, int_val):
     assert SSHConfigDict({"key": int_val}).as_int("key") == 42
예제 #3
0
 def test_SSHConfigDict_as_bool(self, false_ish):
     assert SSHConfigDict({"key": false_ish}).as_bool("key") is False
예제 #4
0
 def test_SSHConfigDict_as_bool_true_ish(self, true_ish):
     assert SSHConfigDict({"key": true_ish}).as_bool("key") is True
예제 #5
0
 def test_SSHConfigDict_construct_from_dict(self):
     assert SSHConfigDict({1: 2})[1] == 2
예제 #6
0
 def test_SSHConfigDict_construct_from_list(self):
     assert SSHConfigDict([(1, 2)])[1] == 2
예제 #7
0
 def test_SSHConfigDict_construct_empty(self):
     assert not SSHConfigDict()