class Test_Noteboard(unittest.TestCase):
    def setUp(self):
        try:
            self._my_class=Noteboard()
        except Exception as excp:
            pass
    
    def test_noteboard_class_instantiates(self):
        self.assertIsInstance(self._my_class, Noteboard, "Could not instantiate Noteboard")
    
    def test_noteboard_returns_page(self):
        code, error=tidylib.tidy_document(self._my_class.noteboard(), options={'show-errors':1,'show-warnings':0})
        self.assertFalse(error, "/notes/noteboard does not return valid html page")

    def test_get_notes(self):
        result=self._my_class.get_notes()
        self.assertIsInstance( result, type([]), "/notes/get_notes does not return array")

    def test_post_note(self):
        code, error=tidylib.tidy_document(self._my_class.post_note(**{'author':'test', 'message':'test'}), options={'show-errors':1,'show-warnings':0})
        self.assertFalse(error, "/notes/post_note does not return valid html page")
Exemple #2
0
class Test_Noteboard(unittest.TestCase):
    def setUp(self):
        try:
            self._my_class = Noteboard()
        except Exception as excp:
            pass

    def test_noteboard_class_instantiates(self):
        self.assertIsInstance(self._my_class, Noteboard,
                              "Could not instantiate Noteboard")

    def test_noteboard_returns_page(self):
        code, error = tidylib.tidy_document(self._my_class.noteboard(),
                                            options={
                                                "show-errors": 1,
                                                "show-warnings": 0
                                            })
        self.assertFalse(error,
                         "/notes/noteboard does not return valid html page")

    def test_get_notes(self):
        result = self._my_class.get_notes()
        self.assertIsInstance(result, type([]),
                              "/notes/get_notes does not return array")

    def test_post_note(self):
        code, error = tidylib.tidy_document(
            self._my_class.post_note(**{
                "author": "test",
                "message": "test"
            }),
            options={
                "show-errors": 1,
                "show-warnings": 0
            },
        )
        self.assertFalse(error,
                         "/notes/post_note does not return valid html page")