Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
software-dev-7054cem/Test/test_user_profile.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
36 lines (29 sloc)
1.11 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from user_profile import Profile | |
class TestProfile(unittest.TestCase): | |
def setUp(self): | |
self.__user = Profile() | |
# we test if attributes exist | |
def test_has_get_email(self): | |
# use built in hasattr() to check if attribute | |
# get_managers exist | |
test_result = hasattr(self.__user, "get_email") | |
self.assertIs(test_result, True) | |
# we test if attributes exist | |
def test_has_set_email(self): | |
# use built in hasattr() to check if attribute | |
# get_managers exist | |
test_result = hasattr(self.__user, "set_email") | |
self.assertIs(test_result, True) | |
# we test if attributes exist | |
def test_has_get_role(self): | |
# use built in hasattr() to check if attribute | |
# get_managers exist | |
test_result = hasattr(self.__user, "get_role") | |
self.assertIs(test_result, True) | |
# we test if attributes exist | |
def test_has_get_role(self): | |
# use built in hasattr() to check if attribute | |
# get_managers exist | |
test_result = hasattr(self.__user, "set_role") | |
self.assertIs(test_result, True) |