示例#1
0
    def test_state_save(self):
        """test_state_save test

        Test save method
        """
        my_state = State()
        my_state.first_name = "Jerry"
        my_state.last_name = "Mouse"
        my_state.email = "*****@*****.**"
        my_state.password = "******"
        my_state.save()
        self.assertTrue(path.exists("file.json"))
        os.remove("file.json")
示例#2
0
    def test_state_instance(self):
        """test_State_instance test

        Test instance class
        """
        my_state = State()
        my_state.first_name = "Jerry"
        my_state.last_name = "Mouse"
        my_state.email = "*****@*****.**"
        my_state.password = "******"
        self.assertEqual(my_state.first_name, "Jerry")
        self.assertEqual(my_state.last_name, "Mouse")
        self.assertEqual(my_state.email, "*****@*****.**")
        self.assertEqual(my_state.password, "root")
示例#3
0
 def test_new_attr(self):
     s = State()
     s.name = "Holberton"
     s.email = "*****@*****.**"
     self.assertTrue(hasattr(s, "name") and hasattr(s, "email"))