Ejemplo n.º 1
0
    def test_report_time(self):
        # Create a test application and report times..
        appid = create_application(self.test_database_uri, "Test App", "Test App Description")
        api = SqlaBilling(self.test_database_uri, appid)
        api.report_time(60)

        # Verify that all is correct.
        db = self.smaker()
        times = db.query(Times).filter_by(app_id=appid).all()
        assert times is not None
        assert len(times) == 1
        assert times[0].time == 60
Ejemplo n.º 2
0
    def test_report_hits(self):
        # Create a test application and report hits.
        appid = create_application(self.test_database_uri, "Test App", "Test App Description")
        api = SqlaBilling(self.test_database_uri, appid)
        api.report_hits(15)

        # Verify that all is correct.
        db = self.smaker()
        hits = db.query(Hits).filter_by(app_id=appid).all()
        assert hits is not None
        assert len(hits) == 1
        assert hits[0].hits == 15
Ejemplo n.º 3
0
    def test_report_time(self):
        # Create a test application and report times..
        appid = create_application(self.test_database_uri, "Test App",
                                   "Test App Description")
        api = SqlaBilling(self.test_database_uri, appid)
        api.report_time(60)

        # Verify that all is correct.
        db = self.smaker()
        times = db.query(Times).filter_by(app_id=appid).all()
        assert times is not None
        assert len(times) == 1
        assert times[0].time == 60
Ejemplo n.º 4
0
    def test_report_hits(self):
        # Create a test application and report hits.
        appid = create_application(self.test_database_uri, "Test App",
                                   "Test App Description")
        api = SqlaBilling(self.test_database_uri, appid)
        api.report_hits(15)

        # Verify that all is correct.
        db = self.smaker()
        hits = db.query(Hits).filter_by(app_id=appid).all()
        assert hits is not None
        assert len(hits) == 1
        assert hits[0].hits == 15