def test_Noneid(self): """This function tests for None argument""" Base.reset_objects() b1 = Base(None) self.assertEqual(b1.id, 1)
def test_id(self): b1 = Base() self.assertEqual(b1.id, 1)
def test_id_positive(self): b4 = Base(12) self.assertEqual(b4.id, 12)
def test_id_str(self): """ test string case """ self.b1 = Base("testing") self.assertEqual(self.b1.id, "testing")
def test_id_tup(self): """ test tuple case """ self.b1 = Base((1, 2, 3)) self.assertEqual(self.b1.id, (1, 2, 3))
def test_id_int(self): """ test integer case """ self.b1 = Base(1) self.assertEqual(self.b1.id, 1)
def test_id_neg(self): """ test negative case """ self.b1 = Base(-1) self.assertEqual(self.b1.id, -1)
def test_none(self): """test none and empty""" g = Base(None) self.assertEqual(2, g.id) g = Base() self.assertEqual(3, g.id)
def test_1arg(self): b = Base(2) self.assertEqual(2, b.id)
def test_str(self): """test strings""" e = Base("6") self.assertEqual("6", e.id) e = Base("666") self.assertEqual("666", e.id)
def test_class(self): """test class type""" f = Base() self.assertFalse(isinstance(type(f), Base))
def test_floats(self): """test floats""" d = Base(6.66) self.assertEqual(6.66, d.id) d = Base(-6.66) self.assertEqual(-6.66, d.id)
def test_int(self): """test integer""" c = Base(666) self.assertEqual(666, c.id)
def test_id(self): '''tests for consecutive auto id assignments''' b1 = Base() b2 = Base() b3 = Base() self.assertTrue(b1.id == 1 and b2.id == 2 and b3.id == 3)
def test_base_dict(self): """ test dict """ B = Base({"Holberton": "School"}) self.assertEqual(B.id, {"Holberton": "School"})
def test_base_zero_args(self): """ test args for our base """ B = Base(1) self.assertEqual(B.id, 1)
def test_id_empty(self): """ test empty case """ self.b1 = Base() self.assertEqual(self.b1.id, 1)
def test_base_negative(self): """ test negative """ B = Base(-1) self.assertEqual(B.id, -1)
def test_id_zero(self): """ test zero case """ self.b1 = Base(0) self.assertEqual(self.b1.id, 0)
def test_base_int(self): """ test int """ B = Base(53) self.assertEqual(B.id, 53)
def test_id_float(self): """ test the float case """ self.b1 = Base(1.2) self.assertEqual(self.b1.id, 1.2)
def test_base_string(self): """ test str """ B = Base("fares") self.assertEqual(B.id, "fares")
def test_id_list(self): """ test list case """ self.b1 = Base([1, 2, 3]) self.assertEqual(self.b1.id, [1, 2, 3])
def test_base_none(self): """ test None """ B = Base(None) self.assertEqual(B.id, 1)
def test_id_dict(self): """ test dictionary case """ self.b1 = Base({'a': 1, 'b': 2}) self.assertEqual(self.b1.id, {'a': 1, 'b': 2})
def test_base_float(self): """ test float """ B = Base(3.14) self.assertEqual(B.id, 3.14)
def test_id_None(self): b1 = Base() self.assertEqual(b1.id, 1) b2 = Base() self.assertEqual(b2.id, 2)
def test_base_list(self): """ test list """ B = Base([1, 2, 3, 4]) self.assertEqual(B.id, [1, 2, 3, 4])
def test_id_negative(self): b5 = Base(-2) self.assertEqual(b5.id, -2) b6 = Base(-4) self.assertEqual(b6.id, -4)
def test_instancecreationwithstringid(self): """This function tests for one instance creation with id""" Base.reset_objects() b1 = Base("foo") self.assertEqual(b1.id, "foo")