예제 #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)
    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
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)
    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()
 def setUp(self):
     self.cls_name = 'TestModel'
     setup()
예제 #9
0
def test_gitlab_push_hook_master():
    app, client = setup()
    with app.app_context():
        gitlab_evt(client, push_hook_master, expected_status=403)
예제 #10
0
def test_gitlab_push_hook_branch():
    app, client = setup()
    with app.app_context():
        gitlab_evt(client, push_hook_branch)
예제 #11
0
def test_github_ping():
    app, client = setup()
    with app.app_context():
        github_evt(client, ping)
예제 #12
0
def test_github_push_branch():
    app, client = setup()
    with app.app_context():
        github_evt(client, push_branch, expected_status=403)
예제 #13
0
def test_github_push_master():
    app, client = setup()
    with app.app_context():
        github_evt(client, push_master)