def test_exe(self): ct = get_credential_format_from_string('exe') self.assertEqual(ct, CredentialFormat.EXE)
def test_pem(self): ct = get_credential_format_from_string('pem') self.assertEqual(ct, CredentialFormat.PEM)
def test_deb(self): ct = get_credential_format_from_string('deb') self.assertEqual(ct, CredentialFormat.DEB)
def test_rpm(self): ct = get_credential_format_from_string('rpm') self.assertEqual(ct, CredentialFormat.RPM)
def test_key(self): ct = get_credential_format_from_string('key') self.assertEqual(ct, CredentialFormat.KEY)
def test_none_or_empty(self): ct = get_credential_format_from_string(None) self.assertIsNone(ct) ct = get_credential_format_from_string('') self.assertIsNone(ct)
def test_invalid(self): with self.assertRaises(InvalidArgument): get_credential_format_from_string('foo')