コード例 #1
0
class Git_Manager_TestCase(unittest.TestCase):

    def setUp(self):
        remote_path = os.path.realpath(os.path.abspath(
            os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0],
                         '..', '..')))
        self.repo = GitManager(remote_path)

    def test_update(self):
        r = self.repo.update()
        self.assertIsInstance(r, dict)
        self.assertIn('deploy.sh', r)
        r = self.repo.update()
        self.assertIn('deploy.sh', r)
コード例 #2
0
ファイル: server_handler.py プロジェクト: chao787/MyWebSite
# Last modified: <2012-09-01 20:58:56 Saturday by richard>

# @version 0.1
# @author : Richard Wong
# Email: [email protected]
import os
import tornado.options
import tornado.web
import tornado.wsgi

from server_lib.server_util import PATH, USE_BAE, ARTICLE_PATH
from server_lib.git_connector import GitManager

_art_manager = GitManager(ARTICLE_PATH)
content_dict = _art_manager.update()


class TempHandler(tornado.web.RequestHandler):
    def get(self):
        if USE_BAE:
            FOOTER_TEXT = "This server is hosted on BAE"
        else:
            FOOTER_TEXT = "This server is hosted on local."

        self.render(
            "index.html",
            title_text = "Dance with Richard",
            header_text = "Welcome to Richard's website. ",
            body_text = str(content_dict.keys()),
            footer_text = FOOTER_TEXT