コード例 #1
0
def _setup():
	"""Test runner setup.

	"""
	tu.setup()
	term = tu.create_term()
	pyessv.save(term)
コード例 #2
0
def _setup():
    """Test runner setup.

    """
    tu.setup()
    count = pyessv.get_count()
    term = tu.create_term()
    pyessv.save(term)
    tu.assert_int(pyessv.get_count(), count + 1)
コード例 #3
0
    def setUp(self):
        setup()
        self.cls_name = 'TestModel'

        class ModelA(models.Model):
            __lc_cls__ = self.cls_name

            name = fields.Field()
            age = fields.Field()

        self.Model = ModelA
コード例 #4
0
ファイル: _test_governance.py プロジェクト: glevava/pyessv
def _test(governance_action, governance_status):
    """Performs governance tests.

    """
    term = tu.get_term()
    tu.assert_str(term.status, pyessv.GOVERNANCE_STATUS_PENDING)
    governance_action(term)
    tu.assert_str(term.status, governance_status)
    pyessv.save(term)

    tu.setup()
    term = tu.get_term()
    tu.assert_str(term.status, governance_status)
コード例 #5
0
def _test(governance_action, governance_status):
    """Performs governance tests.

    """
    term = tu.get_term()
    tu.assert_str(term.status, pyessv.GOVERNANCE_STATUS_PENDING)
    governance_action(term)
    tu.assert_str(term.status, governance_status)
    pyessv.save(term)

    tu.setup()
    print "ZZZ", pyessv.get_count()
    term = tu.get_term()
    print id(term)
    tu.assert_str(term.status, governance_status)
コード例 #6
0
    def setUp(self):
        setup()
        self.cls_name = 'TestModel'

        class ModelA(models.Model):
            __lc_cls__ = self.cls_name

            name = fields.Field()
            age = fields.Field()

        self.Model = ModelA

        self.models = [
            self.Model.create(name='Hi {0}'.format(i), age=18)
            for i in range(100)
        ]
        self.Model.commit_all(*self.models)
コード例 #7
0
    def setUp(self):
        setup()
        self.cls_name = 'TestModel'

        class ModelA(models.Model):
            __lc_cls__ = self.cls_name

            name = fields.Field()
            age = fields.Field()

        self.Model = ModelA

        self.models = [
            self.Model.create(name='Hi', age=18),
            self.Model.create(name='Ho', age=21),
            self.Model.create(name='He', age=23),
        ]
        for model in self.models:
            model.commit()
コード例 #8
0
 def setUp(self):
     self.cls_name = 'TestModel'
     setup()
コード例 #9
0
ファイル: test_gitlab.py プロジェクト: bitxer/deployhook
def test_gitlab_push_hook_master():
    app, client = setup()
    with app.app_context():
        gitlab_evt(client, push_hook_master, expected_status=403)
コード例 #10
0
ファイル: test_gitlab.py プロジェクト: bitxer/deployhook
def test_gitlab_push_hook_branch():
    app, client = setup()
    with app.app_context():
        gitlab_evt(client, push_hook_branch)
コード例 #11
0
ファイル: test_github.py プロジェクト: bitxer/deployhook
def test_github_ping():
    app, client = setup()
    with app.app_context():
        github_evt(client, ping)
コード例 #12
0
ファイル: test_github.py プロジェクト: bitxer/deployhook
def test_github_push_branch():
    app, client = setup()
    with app.app_context():
        github_evt(client, push_branch, expected_status=403)
コード例 #13
0
ファイル: test_github.py プロジェクト: bitxer/deployhook
def test_github_push_master():
    app, client = setup()
    with app.app_context():
        github_evt(client, push_master)