def get_test_case_class(test):
    """
    Returns the test class name, if it can be determined.
    e.g. if test.id() == "smoketests.test_smoke_001.TestCase.test_smoke_001",
    this would return "TestCase".
    Parameter:
      test (unittest.TestCase)
    """
    if hasattr(test, 'id'):
        testcasename = test.id()
    elif hasattr(test, 'test') and hasattr(test.test, 'id'):
        testcasename = test.test.id()
    else:
        return "UNKNOWN"
    components = testcasename.split('.')
    if len(components) >= 3:
        testcasename = components[-2]
    return testcasename