Skip to content
Permalink
1e7b314f38
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
36 lines (29 sloc) 1.11 KB
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)