Example #1
0
    def test_hide_secret(self):
        """Test the hide_secret method of SecretData."""
        data = SecretData()
        data.hide_secret()
        self.assertEqual(data.type, SECRET_TYPE_NONE)
        self.assertEqual(data.value, "")

        data.type = SECRET_TYPE_TEXT
        data.value = "secret"
        data.hide_secret()
        self.assertEqual(data.type, SECRET_TYPE_HIDDEN)
        self.assertEqual(data.value, "")

        data.type = SECRET_TYPE_HIDDEN
        data.value = "secret"
        data.hide_secret()
        self.assertEqual(data.type, SECRET_TYPE_HIDDEN)
        self.assertEqual(data.value, "")
    def test_hide_secret(self):
        """Test the hide_secret method of SecretData."""
        data = SecretData()
        data.hide_secret()
        assert data.type == SECRET_TYPE_NONE
        assert data.value == ""

        data.type = SECRET_TYPE_TEXT
        data.value = "secret"
        data.hide_secret()
        assert data.type == SECRET_TYPE_HIDDEN
        assert data.value == ""

        data.type = SECRET_TYPE_HIDDEN
        data.value = "secret"
        data.hide_secret()
        assert data.type == SECRET_TYPE_HIDDEN
        assert data.value == ""