forked from Ajibose/AirBnB_clone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
user
27 lines (24 loc) · 841 Bytes
/
user
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/python3
"""
Unittests for module models/user,py
"""
from models.user import User
from models.base_model import BaseModel
import unittest
import datetime
class TestUserInstantiation(unittest.TestCase):
"""Test instantiation of User class"""
def test_subclass_of(self):
"""Test if instance is subclass of BaseModel"""
u = User()
self.assertIsInstance(u, BaseModel)
self.assertIsInstance(u, User)
def test_no_arg(self):
"""Test without any argument"""
u = User()
self.assertIn("created_at", u.__dict__)
self.assertIn("updated_at", u.__dict__)
self.assertIn("id", u.__dict__)
self.assertIsInstance(u.id, str)
self.assertIsInstance(u.created_at, datetime.datetime)
self.assertIsInstance(u.updated_at, datetime.datetime)